home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
kboot22.zoo
/
kboot22.2
/
kbox.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-22
|
5KB
|
142 lines
/*
* $Header: /tmp_mnt/home/src/rand/etc/kboot/RCS/kbox.h,v 1.2 91/02/12 19:37:15 root Exp $
*
* $Log: kbox.h,v $
* Revision 1.2 91/02/12 19:37:15 root
* Remove unused commands.
*
* Revision 1.1 91/01/29 17:37:47 root
* Initial revision
*
*/
#define FP_TYPE 'K'
#define FP_CMD 'C'
#define FP_ACK 'A'
#define FP_RESP 'R'
/*
* The fp_state structure declared in cmdmacro.h doesn't align all the
* fields properly when compiled on sparc machines, so kboot uses these
* offsets into an array to access interesting fields.
*/
#define O_ATNET 0 /* Net number appletalk side */
#define O_ETNET 2 /* Net number ethertalk side */
#define O_VALID 4 /* Appletalk node number valid */
#define O_NODE 5 /* Appletalk node number */
#define O_BRIDGE 7 /* Bridge number */
#define O_ETHER 8 /* Ethernet address */
#define O_NAME 14 /* Gateway name */
#define O_FILE 35 /* Loadfile name */
#define O_PFORCE 56 /* Force execution of prom loop */
#define O_ATZONE 62 /* Localtalk zone */
#define O_ETZONE 95 /* Ethertalk zone */
#define O_ETVALID 128 /* Ethertalk node number valid */
#define O_ETNODE 129 /* Ethertalk node number */
#define O_AUTOCONFIG 130 /* Autoconfig switch */
#define O_AUTOBOOT 132 /* Autoboot switch */
#define O_OPTIONS 134 /* Options */
#define O_OPTPARAM 138 /* Optional parameters */
#define O_SN 170 /* Serial number */
#define O_DATE 174 /* Configuration date */
#define O_TYPE 178 /* Type */
#define O_CONFIG 180 /* Name of config file */
#define O_UDPZONE 214 /* UDP zone name */
#define O_IPDEFROUTER 248 /* Default gateway */
#define O_IPADDRESS 252 /* Ip address */
#define O_ATIPADDRESS 256 /* Localtalk IP net */
#define O_IPBROADCAST 260 /* Broadcast address */
#define O_IPSUBMASK 264 /* Subnet mask */
#define O_IPKIPSERVER 268 /* Admin host */
#define O_UDPNET 272 /* UDP net number */
#define O_UDPNODE 274 /* UDP node number */
#define O_NAMESERVER 276 /* DNS host */
#define O_FILESERVER 280 /* File server */
#define O_LP1 284 /* Local parameter 1 */
#define O_LP2 288 /* Local parameter 2 */
#define O_LP3 292 /* Local parameter 3 */
#define O_LP4 296 /* Local parameter 4 */
#define O_NDYNAMICS 300 /* Number of dynamic ip addrs */
#define O_NSTATICS 302 /* Number of static ip addrs */
#define O_SIGNATURE 304 /* Signature */
#define O_AREANODE 308 /* DECnet area and node */
#define O_BACKTIMER 310 /* DECnet routing timer */
#define O_HELLOTIMER 312 /* DECnet hello timer */
#define O_RSTART 314 /* Range start for ET 2.0 */
#define O_REND 316 /* Range end for ET 2.0 */
#define O_ET2NET 318 /* Net number ET 2.0 side */
#define O_ET2VALID 320 /* ET 2.0 node number valid */
#define O_ET2NODE 321 /* ET 2.0 node number */
#define O_ZONELIST 322 /* Zonelist */
#define O_CONFIGTYPES 326 /* Reserved for FPM */
#define O_DATATYPE 330 /* Define following data */
#define O_DATALEN 332 /* Length of following data */
#define O_ATAPOPTIONS 334
#define O_ATAPRETRY 336
#define STATE_LENGTH 0x24A /* Length of state vector */
#define FPCOPYSIZE 10 /* Copy structure size */
#define PROMRAMSIZE 64 /* promram structure size */
#define HTSIZE 32
#define MAXHOSTNAME 64
#define MAXKBOX 256
#define MAXFN 256
#define MAXZONELIST 256
struct kbox {
struct sockaddr_in ip;
int reload;
char name[MAXHOSTNAME];
char bootfile[MAXFN];
char conffile[MAXFN];
struct ether_addr ea;
u_char aa;
struct kbox *nxt;
};
/*
* Send functions with no parameters.
*/
#define send_execute(kp) send_gen (kp, X_EXECUTE, 0)
#define send_promram(kp) send_gen (kp, X_PROMRAM, 5)
#define send_reset(kp) send_gen (kp, X_RESET, 0)
#define send_exprom(kp) send_gen (kp, X_EXPROM, 0)
/*
* Packet used to talk to Kinetics Fastpaths. Does not include link
* level header (ether_header).
*/
#define MAXFPPKT 1024
struct ether_fastpath {
unsigned char fastpath_lapdest;
unsigned char fastpath_lapsrc;
unsigned char fastpath_laptype;
unsigned char fastpath_len[2];
unsigned char fastpath_cmd;
unsigned char fastpath_scmd;
unsigned char fastpath_data[MAXFPPKT];
};
struct fp_packet {
struct ether_header fp_ehdr;
struct ether_fastpath fp_fphdr;
};
#define fp_dhost fp_ehdr.ether_dhost
#define fp_shost fp_ehdr.ether_shost
#define fp_type fp_ehdr.ether_type
#define fp_lapdest fp_fphdr.fastpath_lapdest
#define fp_lapsrc fp_fphdr.fastpath_lapsrc
#define fp_laptype fp_fphdr.fastpath_laptype
#define fp_len fp_fphdr.fastpath_len
#define fp_cmd fp_fphdr.fastpath_cmd
#define fp_scmd fp_fphdr.fastpath_scmd
#define fp_data fp_fphdr.fastpath_data
typedef struct {
short num_elements; /* Number of elements in following array */
short type; /* Type of element (1 for zonelist) */
short bytes; /* Length of element */
} elemlist;
#define NAMELEN 21
#define CONFIGLEN 33