- if (packet_max > offset) {
-
- /* try to apply the plugins */
-#ifdef HAVE_PLUGINS
- plugin *pt_plug = plugin_list;
-
- if (pt_plug) {
- while (pt_plug) {
- if (pt_plug->enabled && !strcmp(pt_plug->protocol, "tcp") &&
- tree && dfilter_apply(pt_plug->filter, tree, pd)) {
- pt_plug->dissector(pd, offset, fd, tree);
- goto reas;
- }
- pt_plug = pt_plug->next;
- }
- }
-#endif
-
- /* ONC RPC. We can't base this on anything in the TCP header; we have
- to look at the payload. If "dissect_rpc()" returns TRUE, it was
- an RPC packet, otherwise it's some other type of packet. */
- if (dissect_rpc(pd, offset, fd, tree))
- goto reas;
-
- /* XXX - this should be handled the way UDP handles this, with a table
- of port numbers to which stuff can be added */
-#define PORT_IS(port) (th.th_sport == port || th.th_dport == port)
- if (PORT_IS(TCP_PORT_PRINTER))
- dissect_lpd(pd, offset, fd, tree);
- else if (PORT_IS(TCP_PORT_TELNET)) {
- pi.match_port = TCP_PORT_TELNET;
- dissect_telnet(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_FTPDATA)) {
- pi.match_port = TCP_PORT_FTPDATA;
- dissect_ftpdata(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_FTP)) {
- pi.match_port = TCP_PORT_FTP;
- dissect_ftp(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_POP)) {
- pi.match_port = TCP_PORT_POP;
- dissect_pop(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_IMAP)) {
- pi.match_port = TCP_PORT_IMAP;
- dissect_imap(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_NNTP)) {
- pi.match_port = TCP_PORT_NNTP;
- dissect_nntp(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_NTP)) {
- pi.match_port = TCP_PORT_NTP;
- dissect_ntp(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_PPTP)) {
- pi.match_port = TCP_PORT_PPTP;
- dissect_pptp(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_HTTP) || PORT_IS(TCP_ALT_PORT_HTTP)
- || PORT_IS(631) || PORT_IS(TCP_PORT_PROXY_HTTP)
- || PORT_IS(TCP_PORT_PROXY_ADMIN_HTTP))
- dissect_http(pd, offset, fd, tree);
- else if (PORT_IS(TCP_PORT_NBSS)) {
- pi.match_port = TCP_PORT_NBSS;
- dissect_nbss(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_RTSP))
- dissect_rtsp(pd, offset, fd, tree);
- else if (PORT_IS(TCP_PORT_BGP)) {
- pi.match_port = TCP_PORT_BGP;
- dissect_bgp(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_TACACS)) {
- pi.match_port = TCP_PORT_TACACS;
- dissect_tacplus(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_MAPI)) {
- pi.match_port = TCP_PORT_MAPI;
- dissect_mapi(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_TNS)) {
- pi.match_port = TCP_PORT_TNS;
- dissect_tns(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_IRC)) {
- pi.match_port = TCP_PORT_IRC;
- dissect_irc(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_LDAP)) {
- pi.match_port = TCP_PORT_LDAP;
- dissect_ldap(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_SRVLOC)) {
- pi.match_port = TCP_PORT_SRVLOC;
- dissect_srvloc(pd, offset, fd, tree);
- } else if (PORT_IS(TCP_PORT_NCP)) {
- pi.match_port = TCP_PORT_NCP;
- dissect_ncp(pd, offset, fd, tree); /* XXX -- need to handle nw_server_address */
- } else {
- /* check existence of high level protocols */
-
- if (memcmp(&pd[offset], "GIOP", 4) == 0) {
- dissect_giop(pd, offset, fd, tree);
- }
- else if ( PORT_IS(TCP_PORT_YHOO) &&
- (memcmp(&pd[offset], "YPNS", 4) == 0 ||
- memcmp(&pd[offset], "YHOO", 4) == 0 )) {
- dissect_yhoo(pd, offset, fd, tree);
- }
- else {
- dissect_data(pd, offset, fd, tree);
- }
- }