home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / bootp-2.2.B / part01 / bootp.h < prev    next >
C/C++ Source or Header  |  1993-10-11  |  4KB  |  138 lines

  1. #ifndef _BLURB_
  2. #define _BLURB_
  3. /************************************************************************
  4.           Copyright 1988, 1991 by Carnegie Mellon University
  5.  
  6.                           All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its
  9. documentation for any purpose and without fee is hereby granted, provided
  10. that the above copyright notice appear in all copies and that both that
  11. copyright notice and this permission notice appear in supporting
  12. documentation, and that the name of Carnegie Mellon University not be used
  13. in advertising or publicity pertaining to distribution of the software
  14. without specific, written prior permission.
  15.  
  16. CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  17. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  18. IN NO EVENT SHALL CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  19. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  20. PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  21. ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22. SOFTWARE.
  23. ************************************************************************/
  24. #endif /* _BLURB_ */
  25.  
  26.  
  27. /*
  28.  * Bootstrap Protocol (BOOTP).  RFC951 and RFC1048.
  29.  *
  30.  * $Header: /afs/andrew.cmu.edu/netdev/src/cmu/bootp-public/RCS/bootp.h,v 1.3 1991/11/01 10:02:29 ww0n Exp ww0n $
  31.  *
  32.  *
  33.  * This file specifies the "implementation-independent" BOOTP protocol
  34.  * information which is common to both client and server.
  35.  *
  36.  */
  37.  
  38.  
  39. #define BP_CHADDR_LEN     16
  40. #define BP_SNAME_LEN     64
  41. #define BP_FILE_LEN    128
  42. #define BP_VEND_LEN     64
  43.  
  44. struct bootp {
  45.     unsigned char    bp_op;            /* packet opcode type */
  46.     unsigned char    bp_htype;            /* hardware addr type */
  47.     unsigned char    bp_hlen;            /* hardware addr length */
  48.     unsigned char    bp_hops;            /* gateway hops */
  49.     unsigned long    bp_xid;            /* transaction ID */
  50.     unsigned short   bp_secs;            /* seconds since boot began */
  51.     unsigned short   bp_unused;
  52.     struct in_addr   bp_ciaddr;            /* client IP address */
  53.     struct in_addr   bp_yiaddr;            /* 'your' IP address */
  54.     struct in_addr   bp_siaddr;            /* server IP address */
  55.     struct in_addr   bp_giaddr;            /* gateway IP address */
  56.     unsigned char    bp_chaddr[BP_CHADDR_LEN];    /* client hardware address */
  57.     unsigned char    bp_sname[BP_SNAME_LEN];    /* server host name */
  58.     unsigned char    bp_file[BP_FILE_LEN];    /* boot file name */
  59.     unsigned char    bp_vend[BP_VEND_LEN];    /* vendor-specific area */
  60. };
  61.  
  62. /*
  63.  * UDP port numbers, server and client.
  64.  */
  65. #define    IPPORT_BOOTPS        67
  66. #define    IPPORT_BOOTPC        68
  67.  
  68. #define BOOTREPLY        2
  69. #define BOOTREQUEST        1
  70.  
  71.  
  72. /*
  73.  * Hardware types from Assigned Numbers RFC.
  74.  */
  75. #define HTYPE_ETHERNET          1
  76. #define HTYPE_EXP_ETHERNET      2
  77. #define HTYPE_AX25          3
  78. #define HTYPE_PRONET          4
  79. #define HTYPE_CHAOS          5
  80. #define HTYPE_IEEE802          6
  81. #define HTYPE_ARCNET          7
  82.  
  83.  
  84.  
  85. /*
  86.  * Vendor magic cookie (v_magic) for CMU
  87.  */
  88. #define VM_CMU        "CMU"
  89.  
  90. /*
  91.  * Vendor magic cookie (v_magic) for RFC1048
  92.  */
  93. #define VM_RFC1048    { 99, 130, 83, 99 }
  94.  
  95.  
  96.  
  97. /*
  98.  * RFC1048 tag values used to specify what information is being supplied in
  99.  * the vendor field of the packet.
  100.  */
  101.  
  102. #define TAG_PAD            ((unsigned char)   0)
  103. #define TAG_SUBNET_MASK        ((unsigned char)   1)
  104. #define TAG_TIME_OFFSET        ((unsigned char)   2)
  105. #define TAG_GATEWAY        ((unsigned char)   3)
  106. #define TAG_TIME_SERVER        ((unsigned char)   4)
  107. #define TAG_NAME_SERVER        ((unsigned char)   5)
  108. #define TAG_DOMAIN_SERVER    ((unsigned char)   6)
  109. #define TAG_LOG_SERVER        ((unsigned char)   7)
  110. #define TAG_COOKIE_SERVER    ((unsigned char)   8)
  111. #define TAG_LPR_SERVER        ((unsigned char)   9)
  112. #define TAG_IMPRESS_SERVER    ((unsigned char)  10)
  113. #define TAG_RLP_SERVER        ((unsigned char)  11)
  114. #define TAG_HOSTNAME        ((unsigned char)  12)
  115. #define TAG_BOOTSIZE        ((unsigned char)  13)
  116. #define TAG_END            ((unsigned char) 255)
  117.  
  118.  
  119.  
  120. /*
  121.  * "vendor" data permitted for CMU bootp clients.
  122.  */
  123.  
  124. struct cmu_vend {
  125.     unsigned char    v_magic[4];    /* magic number */
  126.     unsigned long    v_flags;    /* flags/opcodes, etc. */
  127.     struct in_addr     v_smask;    /* Subnet mask */
  128.     struct in_addr     v_dgate;    /* Default gateway */
  129.     struct in_addr    v_dns1, v_dns2; /* Domain name servers */
  130.     struct in_addr    v_ins1, v_ins2; /* IEN-116 name servers */
  131.     struct in_addr    v_ts1, v_ts2;    /* Time servers */
  132.     unsigned long    v_unused[6];    /* currently unused */
  133. };
  134.  
  135.  
  136. /* v_flags values */
  137. #define VF_SMASK    1    /* Subnet mask field contains valid data */
  138.