/* udp.h */ /* EMACS_MODES: c !fill */ /* Definitions for User Datagram Protocol packets */ #include struct udp { unshort ud_srcp; /* source port */ unshort ud_dstp; /* dest. port */ unshort ud_len; /* length */ unshort ud_cksum; /* checksum */ }; /* The UDP pseudo-header */ struct udpph { in_name ph_src; /* source address */ in_name ph_dest; /* dest. address */ char ph_zero; /* reserved */ char ph_prot; /* protocol */ unshort ph_len; /* udp length */ }; /* Useful Constants */ #define UDPPROT 17 /* UDP protocol number */ #define BIGCKSUM 30 /* breakeven size for fast cksummer */ /* Externals */ extern caddr_t udp_alloc(); /* Useful Macros */ /* Return a pointer to the udp header of a udp packet */ #define udp_head(pip) ((struct udp *)in_data((pip))) /* Return a pointer to the data portion of a udp packet */ #define udp_data(pup) ((caddr_t)(pup) + sizeof (struct udp))