home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / kboot22.zoo / kboot22.2 / kbox.h < prev    next >
C/C++ Source or Header  |  1991-02-22  |  5KB  |  142 lines

  1. /*
  2.  * $Header: /tmp_mnt/home/src/rand/etc/kboot/RCS/kbox.h,v 1.2 91/02/12 19:37:15 root Exp $
  3.  *
  4.  * $Log:    kbox.h,v $
  5.  * Revision 1.2  91/02/12  19:37:15  root
  6.  * Remove unused commands.
  7.  * 
  8.  * Revision 1.1  91/01/29  17:37:47  root
  9.  * Initial revision
  10.  * 
  11.  */
  12.  
  13. #define FP_TYPE        'K'
  14. #define FP_CMD        'C'
  15. #define FP_ACK        'A'
  16. #define FP_RESP        'R'
  17. /*
  18.  * The fp_state structure declared in cmdmacro.h doesn't align all the
  19.  * fields properly when compiled on sparc machines, so kboot uses these
  20.  * offsets into an array to access interesting fields.
  21.  */
  22. #define O_ATNET        0        /* Net number appletalk side    */
  23. #define O_ETNET        2        /* Net number ethertalk side    */
  24. #define O_VALID        4        /* Appletalk node number valid    */
  25. #define O_NODE        5        /* Appletalk node number    */
  26. #define O_BRIDGE    7        /* Bridge number        */
  27. #define O_ETHER        8        /* Ethernet address        */
  28. #define O_NAME        14        /* Gateway name            */
  29. #define O_FILE        35        /* Loadfile name        */
  30. #define O_PFORCE    56        /* Force execution of prom loop    */
  31. #define O_ATZONE    62        /* Localtalk zone        */
  32. #define O_ETZONE    95        /* Ethertalk zone        */
  33. #define O_ETVALID    128        /* Ethertalk node number valid    */
  34. #define O_ETNODE    129        /* Ethertalk node number    */
  35. #define O_AUTOCONFIG    130        /* Autoconfig switch        */
  36. #define O_AUTOBOOT    132        /* Autoboot switch        */
  37. #define O_OPTIONS    134        /* Options            */
  38. #define O_OPTPARAM    138        /* Optional parameters        */
  39. #define O_SN        170        /* Serial number        */
  40. #define O_DATE        174        /* Configuration date        */
  41. #define O_TYPE        178        /* Type                */
  42. #define O_CONFIG    180        /* Name of config file        */
  43. #define O_UDPZONE    214        /* UDP zone name        */
  44. #define O_IPDEFROUTER    248        /* Default gateway        */
  45. #define O_IPADDRESS    252        /* Ip address            */
  46. #define O_ATIPADDRESS    256        /* Localtalk IP net        */
  47. #define O_IPBROADCAST    260        /* Broadcast address        */
  48. #define O_IPSUBMASK    264        /* Subnet mask            */
  49. #define O_IPKIPSERVER    268        /* Admin host            */
  50. #define O_UDPNET    272        /* UDP net number        */
  51. #define O_UDPNODE    274        /* UDP node number        */ 
  52. #define O_NAMESERVER    276        /* DNS host            */
  53. #define O_FILESERVER    280        /* File server            */
  54. #define O_LP1        284        /* Local parameter 1        */
  55. #define O_LP2        288        /* Local parameter 2        */
  56. #define O_LP3        292        /* Local parameter 3        */
  57. #define O_LP4        296        /* Local parameter 4        */
  58. #define O_NDYNAMICS    300        /* Number of dynamic ip addrs    */
  59. #define O_NSTATICS    302        /* Number of static ip addrs    */
  60. #define O_SIGNATURE    304        /* Signature            */
  61. #define O_AREANODE    308        /* DECnet area and node        */
  62. #define O_BACKTIMER    310        /* DECnet routing timer        */
  63. #define O_HELLOTIMER    312        /* DECnet hello timer        */
  64. #define O_RSTART    314        /* Range start for ET 2.0    */
  65. #define O_REND        316        /* Range end for ET 2.0        */
  66. #define O_ET2NET    318        /* Net number ET 2.0 side    */
  67. #define O_ET2VALID    320        /* ET 2.0 node number valid    */
  68. #define O_ET2NODE    321        /* ET 2.0 node number        */
  69. #define O_ZONELIST    322        /* Zonelist            */
  70. #define O_CONFIGTYPES    326        /* Reserved for FPM        */
  71. #define O_DATATYPE    330        /* Define following data    */
  72. #define O_DATALEN    332        /* Length of following data    */
  73. #define O_ATAPOPTIONS    334
  74. #define O_ATAPRETRY    336
  75.  
  76. #define STATE_LENGTH    0x24A        /* Length of state vector    */
  77. #define FPCOPYSIZE    10        /* Copy structure size        */
  78. #define PROMRAMSIZE    64        /* promram structure size    */
  79. #define HTSIZE        32
  80. #define MAXHOSTNAME    64
  81. #define MAXKBOX        256
  82. #define MAXFN        256
  83. #define MAXZONELIST    256
  84.  
  85. struct kbox {
  86.   struct sockaddr_in    ip;
  87.   int            reload;
  88.   char            name[MAXHOSTNAME];
  89.   char            bootfile[MAXFN];
  90.   char            conffile[MAXFN];
  91.   struct ether_addr    ea;
  92.   u_char        aa;
  93.   struct kbox        *nxt;
  94. };
  95.  
  96. /*
  97.  * Send functions with no parameters.
  98.  */
  99. #define send_execute(kp)    send_gen (kp, X_EXECUTE, 0)
  100. #define send_promram(kp)    send_gen (kp, X_PROMRAM, 5)
  101. #define send_reset(kp)        send_gen (kp, X_RESET, 0)
  102. #define send_exprom(kp)        send_gen (kp, X_EXPROM, 0)
  103.  
  104. /*
  105.  * Packet used to talk to Kinetics Fastpaths.  Does not include link
  106.  * level header (ether_header).
  107.  */
  108. #define MAXFPPKT    1024
  109. struct ether_fastpath {
  110.   unsigned char        fastpath_lapdest;
  111.   unsigned char        fastpath_lapsrc;
  112.   unsigned char        fastpath_laptype;
  113.   unsigned char        fastpath_len[2];
  114.   unsigned char        fastpath_cmd;
  115.   unsigned char        fastpath_scmd;
  116.   unsigned char        fastpath_data[MAXFPPKT];
  117. };
  118.  
  119. struct fp_packet {
  120.   struct ether_header    fp_ehdr;
  121.   struct ether_fastpath    fp_fphdr;
  122. };
  123. #define fp_dhost    fp_ehdr.ether_dhost
  124. #define fp_shost    fp_ehdr.ether_shost
  125. #define fp_type        fp_ehdr.ether_type
  126. #define fp_lapdest    fp_fphdr.fastpath_lapdest
  127. #define fp_lapsrc    fp_fphdr.fastpath_lapsrc
  128. #define fp_laptype    fp_fphdr.fastpath_laptype
  129. #define fp_len        fp_fphdr.fastpath_len
  130. #define fp_cmd        fp_fphdr.fastpath_cmd
  131. #define fp_scmd        fp_fphdr.fastpath_scmd
  132. #define fp_data        fp_fphdr.fastpath_data
  133.  
  134. typedef struct {
  135.   short    num_elements;    /* Number of elements in following array    */
  136.   short    type;        /* Type of element (1 for zonelist)        */
  137.   short    bytes;        /* Length of element                */
  138. } elemlist;
  139.  
  140. #define NAMELEN        21
  141. #define CONFIGLEN    33
  142.