duplicate TIOCGPGRP for controller - minus the check for controlling terminal
[unix-history] / usr / src / sys / netinet / ip_var.h
index 337a18a..0ca62de 100644 (file)
@@ -1,4 +1,21 @@
-/*     ip_var.h        4.5     81/12/02        */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)ip_var.h    7.6 (Berkeley) %G%
+ */
 
 /*
  * Overlay for ip header used by other protocols (tcp, udp).
 
 /*
  * Overlay for ip header used by other protocols (tcp, udp).
@@ -30,10 +47,18 @@ struct ipq {
 
 /*
  * Ip header, when holding a fragment.
 
 /*
  * Ip header, when holding a fragment.
+ *
+ * Note: ipf_next must be at same offset as ipq_next above
  */
 struct ipasfrag {
  */
 struct ipasfrag {
+#if BYTE_ORDER == LITTLE_ENDIAN 
        u_char  ip_hl:4,
                ip_v:4;
        u_char  ip_hl:4,
                ip_v:4;
+#endif
+#if BYTE_ORDER == BIG_ENDIAN 
+       u_char  ip_v:4,
+               ip_hl:4;
+#endif
        u_char  ipf_mff;                /* copied from (ip_off&IP_MF) */
        short   ip_len;
        u_short ip_id;
        u_char  ipf_mff;                /* copied from (ip_off&IP_MF) */
        short   ip_len;
        u_short ip_id;
@@ -45,14 +70,51 @@ struct      ipasfrag {
        struct  ipasfrag *ipf_prev;     /* previous fragment */
 };
 
        struct  ipasfrag *ipf_prev;     /* previous fragment */
 };
 
+/*
+ * Structure stored in mbuf in inpcb.ip_options
+ * and passed to ip_output when ip options are in use.
+ * The actual length of the options (including ipopt_dst)
+ * is in m_len.
+ */
+#define MAX_IPOPTLEN   40
+
+struct ipoption {
+       struct  in_addr ipopt_dst;      /* first-hop dst if source routed */
+       char    ipopt_list[MAX_IPOPTLEN];       /* options proper */
+};
+
 struct ipstat {
 struct ipstat {
-       int     ips_badsum;             /* checksum bad */
-       int     ips_tooshort;           /* packet too short */
+       long    ips_total;              /* total packets received */
+       long    ips_badsum;             /* checksum bad */
+       long    ips_tooshort;           /* packet too short */
+       long    ips_toosmall;           /* not enough data */
+       long    ips_badhlen;            /* ip header length < data size */
+       long    ips_badlen;             /* ip length < ip header length */
+       long    ips_fragments;          /* fragments received */
+       long    ips_fragdropped;        /* frags dropped (dups, out of space) */
+       long    ips_fragtimeout;        /* fragments timed out */
+       long    ips_forward;            /* packets forwarded */
+       long    ips_cantforward;        /* packets rcvd for unreachable dest */
+       long    ips_redirectsent;       /* packets forwarded on same net */
+       long    ips_noproto;            /* unknown or unsupported protocol */
+       long    ips_delivered;          /* packets consumed here */
+       long    ips_localout;           /* total ip packets generated here */
+       long    ips_odropped;           /* lost packets due to nobufs, etc. */
+       long    ips_reassembled;        /* total packets reassembled ok */
+       long    ips_fragmented;         /* output packets fragmented ok */
+       long    ips_ofragments;         /* output fragments created */
+       long    ips_cantfrag;           /* don't fragment flag was set, etc. */
 };
 
 #ifdef KERNEL
 };
 
 #ifdef KERNEL
+/* flags passed to ip_output as last parameter */
+#define        IP_FORWARDING           0x1             /* most of ip header exists */
+#define        IP_ROUTETOIF            SO_DONTROUTE    /* bypass routing tables */
+#define        IP_ALLOWBROADCAST       SO_BROADCAST    /* can send broadcast packets */
+
 struct ipstat  ipstat;
 struct ipq     ipq;                    /* ip reass. queue */
 struct ipstat  ipstat;
 struct ipq     ipq;                    /* ip reass. queue */
-struct ipq     *ip_freef();
 u_short        ip_id;                          /* ip packet ctr, for ids */
 u_short        ip_id;                          /* ip packet ctr, for ids */
+
+struct mbuf *ip_srcroute();
 #endif
 #endif