new version: macros and fast cksum
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Thu, 15 Oct 1981 11:12:16 +0000 (03:12 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Thu, 15 Oct 1981 11:12:16 +0000 (03:12 -0800)
SCCS-vsn: sys/netinet/ip.h 1.2
SCCS-vsn: sys/netinet/ip_input.c 1.2

usr/src/sys/netinet/ip.h
usr/src/sys/netinet/ip_input.c

index 81434db..f875495 100644 (file)
@@ -1,4 +1,4 @@
-/* ip.h 1.1 81/10/14 */
+/* ip.h 1.2 81/10/14 */
 struct ip {                     /* ip leader */
        unsigned char ip_hl:4,          /* header length */
                ip_v:4;                 /* version */
 struct ip {                     /* ip leader */
        unsigned char ip_hl:4,          /* header length */
                ip_v:4;                 /* version */
@@ -40,3 +40,8 @@ struct ipq {                    /* ip reass.q header */
 #define IPLINK IPLOLINK
 #define MAXTTL 255              /* maximum time to live (seconds) */
 
 #define IPLINK IPLOLINK
 #define MAXTTL 255              /* maximum time to live (seconds) */
 
+#define        ip_bswap(p) { \
+       p->ip_len = ntohs(p->ip_len); \
+       p->ip_id = ntohs(p->ip_id); \
+       p->ip_off = ntohs(p->ip_off); }
+
index c76b124..53a68bd 100644 (file)
@@ -1,4 +1,4 @@
-/* ip_input.c 1.1 81/10/14 */
+/* ip_input.c 1.2 81/10/14 */
 #include "../h/param.h"
 #include "../bbnnet/net.h"
 #include "../bbnnet/tcp.h"
 #include "../h/param.h"
 #include "../bbnnet/net.h"
 #include "../bbnnet/tcp.h"
@@ -382,15 +382,6 @@ COUNT(IP_DEQ);
        p->ip_next->ip_prev = p->ip_prev;
 }
 
        p->ip_next->ip_prev = p->ip_prev;
 }
 
-ip_bswap(p)    /* byte swap ip header */
-register struct ip *p;
-{
-COUNT(IP_BSWAP);
-       p->ip_len = ntohs(p->ip_len);
-       p->ip_id = ntohs(p->ip_id);
-       p->ip_off = ntohs(p->ip_off);
-}
-
 ip_timeo()      /* frag reass.q timeout routine */
 {
        register struct ip *q;
 ip_timeo()      /* frag reass.q timeout routine */
 {
        register struct ip *q;