home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / MSWATTCP.ZIP / INCLUDE / BOOTP.H next >
Encoding:
C/C++ Source or Header  |  1993-03-25  |  2.4 KB  |  78 lines

  1. /***
  2.  *
  3.  * File: bootp.h
  4.  *
  5.  * 18-Jun-92 lr
  6.  *
  7.  * Bootstrap Protocol (BOOTP)
  8.  * Based on RFC 951.
  9.  */
  10.  
  11.  
  12. #define BOOTREQUEST     1    /* bootp.bp_op */
  13. #define BOOTREPLY    2
  14.  
  15. /*
  16.  * structure for send and receives
  17.  */
  18. struct bootp {
  19.     byte     bp_op;        /* packet op code / message type. */
  20.     byte     bp_htype;    /* hardware address type, 1 = 10 mb ethernet */
  21.     byte     bp_hlen;    /* hardware address len, eg '6' for 10mb eth */
  22.     byte     bp_hops;    /* client sets to zero, optionally used by
  23.                    gateways in cross-gateway booting. */
  24.     longword bp_xid;    /* transaction ID, a random number */
  25.     word     bp_secs;    /* filled in by client, seconds elapsed since
  26.                    client started trying to boot. */
  27.     word     bp_spare;
  28.     longword bp_ciaddr;    /* client IP addr filled in by client if known*/
  29.     longword bp_yiaddr;    /* 'your' (client) IP address
  30.                    filled by server if client doesn't know */
  31.     longword bp_siaddr;    /* server IP address returned in bootreply */
  32.     longword bp_giaddr;    /* gateway IP address,
  33.                    used in optional cross-gateway booting. */
  34.     byte     bp_chaddr[16];    /* client hardware address, filled by client */
  35.     byte     bp_sname[64];    /* optional server host name, null terminated*/
  36.  
  37.     byte     bp_file[128];    /* boot file name, null terminated string
  38.                    'generic' name or null in bootrequest,
  39.                    fully qualified directory-path
  40.                    name in bootreply. */
  41.     byte     bp_vend[ 64];    /* optional vendor-specific area */
  42. };
  43.  
  44.  
  45. extern struct bootp _bootp;
  46. extern word sock_inactive;
  47.  
  48. /*
  49.  * UDP port numbers, server and client.
  50.  */
  51. #define    IPPORT_BOOTPS        67
  52. #define    IPPORT_BOOTPC        68
  53.  
  54.  
  55. /******** the following is stolen from NCSA which came from CUTCP *********/
  56. /* I have not implemented these, but someone may wish to in the future so */
  57. /* I kept them around.                                                    */
  58. /**************************************************************************/
  59.  
  60. /*
  61.  * "vendor" data permitted for Stanford boot clients.
  62.  */
  63. struct vend {
  64.     byte      v_magic[4];    /* magic number */
  65.     longword v_flags;    /* flags/opcodes, etc. */
  66.     byte      v_unused[56];    /* currently unused */
  67. };
  68.  
  69. #define    VM_STANFORD    "STAN"    /* v_magic for Stanford */
  70. #define VM_RFC1048      0x63825363L
  71.  
  72. /* v_flags values */
  73. #define    VF_PCBOOT    1    /* an IBMPC or Mac wants environment info */
  74. #define    VF_HELP        2    /* help me, I'm not registered */
  75. #define TAG_BOOTFILE_SIZE       13     /* tag used by vend fields rfc 1048 */
  76.  
  77. /*** end of file bootp.h ***/
  78.