|
|
1.1 ! root 1: /* ip.h 6.1 83/07/29 */ ! 2: ! 3: /* ! 4: * Definitions for internet protocol version 4. ! 5: * Per RFC 791, September 1981. ! 6: */ ! 7: #define IPVERSION 4 ! 8: ! 9: /* ! 10: * Structure of an internet header, naked of options. ! 11: * ! 12: * We declare ip_len and ip_off to be short, rather than u_short ! 13: * pragmatically since otherwise unsigned comparisons can result ! 14: * against negative integers quite easily, and fail in subtle ways. ! 15: */ ! 16: struct ip { ! 17: #ifdef VAX ! 18: u_char ip_hl:4, /* header length */ ! 19: ip_v:4; /* version */ ! 20: #else /* Default to TAHOE style */ ! 21: u_char ip_v:4, /* Version */ ! 22: ip_hl:4; /* header len */ ! 23: #endif VAX ! 24: u_char ip_tos; /* type of service */ ! 25: short ip_len; /* total length */ ! 26: u_short ip_id; /* identification */ ! 27: short ip_off; /* fragment offset field */ ! 28: #define IP_DF 0x4000 /* dont fragment flag */ ! 29: #define IP_MF 0x2000 /* more fragments flag */ ! 30: u_char ip_ttl; /* time to live */ ! 31: u_char ip_p; /* protocol */ ! 32: u_short ip_sum; /* checksum */ ! 33: struct in_addr ip_src,ip_dst; /* source and dest address */ ! 34: }; ! 35: ! 36: /* ! 37: * Definitions for options. ! 38: */ ! 39: #define IPOPT_COPIED(o) ((o)&0x80) ! 40: #define IPOPT_CLASS(o) ((o)&0x40) ! 41: #define IPOPT_NUMBER(o) ((o)&0x3f) ! 42: ! 43: #define IPOPT_CONTROL 0x00 ! 44: #define IPOPT_RESERVED1 0x10 ! 45: #define IPOPT_DEBMEAS 0x20 ! 46: #define IPOPT_RESERVED2 0x30 ! 47: ! 48: #define IPOPT_EOL 0 /* end of option list */ ! 49: #define IPOPT_NOP 1 /* no operation */ ! 50: ! 51: #define IPOPT_RR 7 /* record packet route */ ! 52: #define IPOPT_TS 68 /* timestamp */ ! 53: #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ ! 54: #define IPOPT_LSRR 131 /* loose source route */ ! 55: #define IPOPT_SATID 136 /* satnet id */ ! 56: #define IPOPT_SSRR 137 /* strict source route */ ! 57: ! 58: /* ! 59: * Time stamp option structure. ! 60: */ ! 61: struct ip_timestamp { ! 62: u_char ipt_code; /* IPOPT_TS */ ! 63: u_char ipt_len; /* size of structure (variable) */ ! 64: u_char ipt_ptr; /* index of current entry */ ! 65: u_char ipt_flg:4, /* flags, see below */ ! 66: ipt_oflw:4; /* overflow counter */ ! 67: union { ! 68: n_long ipt_time[1]; ! 69: struct ipt_ta { ! 70: struct in_addr ipt_addr; ! 71: n_long ipt_time; ! 72: } ipt_ta[1]; ! 73: } ! 74: }; ! 75: ! 76: /* flag bits for ipt_flg */ ! 77: #define IPOPT_TS_TSONLY 0 /* timestamps only */ ! 78: #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ ! 79: #define IPOPT_TS_PRESPEC 2 /* specified modules only */ ! 80: ! 81: /* bits for security (not byte swapped) */ ! 82: #define IPOPT_SECUR_UNCLASS 0x0000 ! 83: #define IPOPT_SECUR_CONFID 0xf135 ! 84: #define IPOPT_SECUR_EFTO 0x789a ! 85: #define IPOPT_SECUR_MMMM 0xbc4d ! 86: #define IPOPT_SECUR_RESTR 0xaf13 ! 87: #define IPOPT_SECUR_SECRET 0xd788 ! 88: #define IPOPT_SECUR_TOPSECRET 0x6bc5 ! 89: ! 90: /* ! 91: * Internet implementation parameters. ! 92: */ ! 93: #define MAXTTL 255 /* maximum time to live (seconds) */ ! 94: #define IPFRAGTTL 15 /* time to live for frag chains */ ! 95: #define IPTTLDEC 5 /* subtracted when forwarding */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.