|
|
1.1 ! root 1: /* netboot ! 2: * ! 3: * inet.h,v ! 4: * Revision 1.1 1993/07/08 16:03:59 brezak ! 5: * Diskless boot prom code from Jim McKim ([email protected]) ! 6: * ! 7: * Revision 1.1.1.1 1993/05/28 11:41:07 mckim ! 8: * Initial version. ! 9: * ! 10: * ! 11: * source in this file came from ! 12: * the Mach ethernet boot written by Leendert van Doorn. ! 13: * ! 14: * Various UDP/IP definitions (see RFC 768, and 791) ! 15: */ ! 16: ! 17: /* generic IP address */ ! 18: #define IP_ANYADDR (ipaddr_t)0 /* IP any address */ ! 19: #define IP_BCASTADDR (ipaddr_t)0xffffffff /* IP broadcast address */ ! 20: ! 21: /* some well defined protocols/ports */ ! 22: #define IP_PROTO_UDP 17 /* user datagram protocol */ ! 23: #define IP_PORT_TFTP 69 /* trivial FTP port */ ! 24: ! 25: /* internet address type */ ! 26: typedef u_long ipaddr_t; ! 27: ! 28: /* internet address type (only used for printing address) */ ! 29: typedef union { ! 30: ipaddr_t a; ! 31: struct { u_char a0, a1, a2, a3; } s; ! 32: } inetaddr_t; ! 33: ! 34: /* ! 35: * Structure of an internet header (without options) ! 36: */ ! 37: typedef struct { ! 38: u_char ip_vhl; /* version and header length */ ! 39: #define IP_VERSION 4 /* current version number */ ! 40: u_char ip_tos; /* type of service */ ! 41: u_short ip_len; /* total length */ ! 42: u_short ip_id; /* identification */ ! 43: u_short ip_off; /* fragment offset field */ ! 44: u_char ip_ttl; /* time to live */ ! 45: #define IP_FRAGTTL 60 /* time to live for frags */ ! 46: u_char ip_p; /* protocol */ ! 47: u_short ip_sum; /* checksum */ ! 48: ipaddr_t ip_src; /* source address */ ! 49: ipaddr_t ip_dst; /* destination address */ ! 50: } iphdr_t; ! 51: ! 52: /* ! 53: * Structure of an UDP header ! 54: */ ! 55: typedef struct { ! 56: u_short uh_sport; /* source port */ ! 57: u_short uh_dport; /* destination port */ ! 58: u_short uh_len; /* udp length */ ! 59: u_short uh_sum; /* udp checksum */ ! 60: } udphdr_t; ! 61: ! 62: /* these are actually defined in arp.c */ ! 63: extern ipaddr_t ip_myaddr; /* my own IP address */ ! 64: extern ipaddr_t ip_gateway; /* gateway's IP address */ ! 65: ! 66: void IpPrintAddr(ipaddr_t);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.