home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / NCSA / TEL2307S.ZIP / INCLUDE / BOOTP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-07  |  1.6 KB  |  59 lines

  1. /*
  2.  * Bootstrap Protocol (BOOTP).  RFC 951.
  3.  */
  4.  
  5. #ifndef BOOTP_H
  6. #define BOOTP_H
  7.  
  8. typedef uint8   u_char;
  9. typedef uint32  u_long;
  10. typedef uint16  u_short;
  11. typedef struct { u_char addr[4]; } iaddr_t;
  12.  
  13. struct bootp {
  14.     u_char    bp_op;        /* packet opcode type */
  15. #define    BOOTREQUEST    1
  16. #define    BOOTREPLY    2
  17.     u_char    bp_htype;    /* hardware addr type */
  18.     u_char    bp_hlen;    /* hardware addr length */
  19.     u_char    bp_hops;    /* gateway hops */
  20.     u_long    bp_xid;        /* transaction ID */
  21.     u_short    bp_secs;    /* seconds since boot began */    
  22.     u_short    bp_unused;
  23.     iaddr_t    bp_ciaddr;    /* client IP address */
  24.     iaddr_t    bp_yiaddr;    /* 'your' IP address */
  25.     iaddr_t    bp_siaddr;    /* server IP address */
  26.     iaddr_t    bp_giaddr;    /* gateway IP address */
  27.     u_char    bp_chaddr[16];    /* client hardware address */
  28.     u_char    bp_sname[64];    /* server host name */
  29.     u_char    bp_file[128];    /* boot file name */
  30.     u_char    bp_vend[64];    /* vendor-specific area */
  31. };
  32.  
  33. /*
  34.  * UDP port numbers, server and client.
  35.  */
  36. #define IPPORT_BOOTPS       67
  37. #define    IPPORT_BOOTPC        68
  38.  
  39. /*
  40.  * "vendor" data permitted for Stanford boot clients.
  41.  */
  42. struct vend {
  43.     u_char    v_magic[4];    /* magic number */
  44.     u_long    v_flags;    /* flags/opcodes, etc. */
  45.     u_char    v_unused[56];    /* currently unused */
  46. };
  47.  
  48. #define    VM_STANFORD    "STAN"    /* v_magic for Stanford */
  49. #define VM_RFC1048      "\143\202\123\143"
  50.  
  51. /* v_flags values */
  52. #define    VF_PCBOOT    1    /* an IBMPC or Mac wants environment info */
  53. #define    VF_HELP        2    /* help me, I'm not registered */
  54. #define TAG_BOOTFILE_SIZE       13     /* tag used by vend fields rfc 1048 */
  55.  
  56. #define BOOTP_RETRIES   10
  57.  
  58. #endif
  59.