- /* ONC RPC. We can't base this on anything in the UDP 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))
- return;
-
- /* XXX - we should do all of this through the table of ports. */
-#define PORT_IS(port) (uh_sport == port || uh_dport == port)
- if (PORT_IS(UDP_PORT_BOOTPS))
- dissect_bootp(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_DNS))
- dissect_dns(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_SRVLOC))
- dissect_srvloc(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_ISAKMP))
- dissect_isakmp(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_RIP)) {
- /* we should check the source port too (RIP: UDP src and dst port 520) */
- dissect_rip(pd, offset, fd, tree);
- } else if (PORT_IS(UDP_PORT_RIPNG))
- dissect_ripng(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_NCP))
- dissect_ncp(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_NBNS))
- dissect_nbns(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_NBDGM))
- dissect_nbdgm(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_NTP))
- dissect_ntp(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_IPX)) /* RFC 1234 */
- dissect_ipx(pd, offset, fd, tree);
- else if ((uh_sport >= UDP_PORT_RX_LOW && uh_sport <= UDP_PORT_RX_HIGH) ||
- (uh_dport >= UDP_PORT_RX_LOW && uh_dport <= UDP_PORT_RX_HIGH) ||
- PORT_IS(UDP_PORT_RX_AFS_BACKUPS))
- dissect_rx(pd, offset, fd, tree); /* transarc AFS's RX protocol */
- else if (PORT_IS(UDP_PORT_SNMP))
- dissect_snmp(pd, offset, fd, tree);
- else if (PORT_IS(UDP_PORT_VINES)) {
- /* FIXME: AFAIK, src and dst port must be the same */
- dissect_vines_frp(pd, offset, fd, tree);
- } else if (PORT_IS(UDP_PORT_TFTP)) {
- /* This is the first point of call, but it adds a dynamic call */
- udp_hash_add(MAX(uh_sport, uh_dport), dissect_tftp); /* Add to table */
- dissect_tftp(pd, offset, fd, tree);
- } else if (PORT_IS(UDP_PORT_RADIUS) ||
- PORT_IS(UDP_PORT_RADACCT) ||
- PORT_IS(UDP_PORT_RADIUS_NEW) ||
- PORT_IS(UDP_PORT_RADACCT_NEW) ) {
- dissect_radius(pd, offset, fd, tree);
- } else if ( PORT_IS(UDP_PORT_ICP)) {
- dissect_icp(pd,offset,fd,tree);
- } else if ( PORT_IS(UDP_PORT_ICQ)) {
- dissect_icq(pd,offset,fd,tree);
- } else {
- /* OK, find a routine in the table, else use the default */
-
- if ((dissect_routine = udp_find_hash_ent(uh_sport))) {
-
- struct hash_struct *dr2 = udp_find_hash_ent(uh_dport);
-
- if (dr2 == NULL) { /* Not in the table, add */
-
- udp_hash_add(uh_dport, dissect_tftp);
-
- }
-
- dissect_routine -> dissect(pd, offset, fd, tree);
- }
- else if ((dissect_routine = udp_find_hash_ent(uh_dport))) {
-
- dissect_routine -> dissect(pd, offset, fd, tree);