home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / wattcp.zip / BOOTP.H < prev    next >
C/C++ Source or Header  |  1991-11-04  |  2KB  |  74 lines

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