# /* udp_swab.c */ /* EMACS_MODES: c !fill */ /* User Datagram Protocol layer for the UNIX network system. The * following routines are included: * udpswab swap the bytes in 16-bit integers in a udp packet */ #include #ifndef BIGINDIAN udpswab (pup) /* Swap bytes in integer fields (except sumcheck fields) of udp packet. * * Arguments: */ struct udp *pup; /* ptr. to udp hdr of packet */ { static int swabads[] = { &0->ud_srcp, &0->ud_dstp, &0->ud_len, }; swaba((char *)pup, swabads, (sizeof (swabads)/sizeof (swabads[0]))); } #endif