home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / NETWORK / TEL23SRC.ZIP / INCLUDE / BOOTP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-14  |  1.6 KB  |  59 lines

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