home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / BOOTP.H < prev    next >
C/C++ Source or Header  |  1994-04-17  |  3KB  |  77 lines

  1. /*************************************************/
  2. /* Center for Information Technology Integration */
  3. /*           The University of Michigan          */
  4. /*                    Ann Arbor                  */
  5. /*                                               */
  6. /* Dedicated to the public domain.               */
  7. /* Send questions to info@citi.umich.edu         */
  8. /*                                               */
  9. /* BOOTP is documented in RFC 951 and RFC 1048   */
  10. /*************************************************/
  11.   
  12. #ifndef BOOTREQUEST
  13. #include "socket.h"
  14.   
  15.   
  16. struct bootp {
  17.     char    op;         /* packet opcode type */
  18.     char    htype;          /* hardware addr type */
  19.     char    hlen;           /* hardware addr length */
  20.     char    hops;           /* gateway hops */
  21.     int32   xid;            /* transaction ID */
  22.     int16   secs;           /* seconds since boot began */
  23.     int16   unused;
  24.     struct in_addr  ciaddr;     /* client IP address */
  25.     struct in_addr  yiaddr;     /* 'your' IP address */
  26.     struct in_addr  siaddr;     /* server IP address */
  27.     struct in_addr  giaddr;     /* gateway IP address */
  28.     char    chaddr[16];     /* client hardware address */
  29.     char    sname[64];      /* server host name */
  30.     char    file[128];      /* boot file name */
  31.     char    vend[64];       /* vendor-specific area */
  32. };
  33.   
  34. /*
  35.  * UDP port numbers, server and client.
  36.  */
  37. #define IPPORT_BOOTPS       67
  38. #define IPPORT_BOOTPC       68
  39.   
  40. #define BOOTREQUEST     1
  41. #define BOOTREPLY       2
  42.   
  43. #define BOOTP_PAD       0
  44. #define BOOTP_SUBNET        1
  45. #define BOOTP_GATEWAY       3
  46. #define BOOTP_DNS       6
  47. #define BOOTP_HOSTNAME      12
  48. #define BOOTP_END       0xff
  49.   
  50. /*
  51.  * "vendor" data permitted for Stanford boot clients.
  52.  */
  53. struct vend {
  54.     unsigned char  v_magic[4];     /* magic number */
  55.     unsigned long  v_flags;        /* flags/opcodes, etc. */
  56.     unsigned char  v_unused[56];   /* currently unused */
  57. };
  58.   
  59. #define VM_STANFORD     "STAN"  /* v_magic for Stanford */
  60.   
  61. /* v_flags values */
  62. #define VF_PCBOOT       1       /* an IBMPC or Mac wants environment info */
  63. #define VF_HELP         2       /* help me, I'm not registered */
  64.   
  65. extern int WantBootp;
  66. extern char bp_ascii[];
  67.   
  68. #ifdef __GNUC__
  69. struct ip;            /* forward declaration */
  70. #endif
  71.   
  72. void bootp_print_packet __ARGS((struct bootp *bp));
  73. int bootp_validPacket __ARGS((struct ip *ip,struct mbuf **bpp));
  74.   
  75. #endif
  76.   
  77.