home *** CD-ROM | disk | FTP | other *** search
- /*
- * netbios version of c-tree
- * netbios data structures, cmd codes, err codes, etc
- *
- * This program is the CONFIDENTIAL and PROPRIETARY property
- * of FairCom(R) Corporation. Any unauthorized use, reproduction or
- * transfer of this program is strictly prohibited.
- *
- * Copyright (c) 1987, 1988, 1989 FairCom Corporation
- * (Subject to limited distribution and
- * restricted disclosure only.)
- * *** ALL RIGHTS RESERVED ***
- *
- * 4006 West Broadway
- * Columbia, MO 65203
- *
- *
- * c-tree(R) Version 4.3
- * Release C
- * February 7, 1989 17:30
- *
- */
-
- /*
- *
- * NOTE for MS-C compiler, the structure member alignment for the
- * netbios data structures works out ok without having to use the
- * pack structures (/Zp) switch
- */
-
-
- /**************************
- * NETWORK COMMAND BLOCKS *
- **************************/
-
- /*
- * Network Control Block
- *
- * Notes: bufptr and anr are really 32 bit 8086 type pointers. they are
- * treated as ULONGs to avoid model decisions here.
- */
-
- typedef struct ncb
- {
- UTEXT cmd; /* command code NCBxxxx */
- UTEXT err; /* error result NERRxxxx */
- UTEXT lsn; /* session number */
- UTEXT namenum; /* name number */
- UTEXT far *bufptr; /* buffer far pointer */
- UCOUNT buflen; /* buffer length */
- UTEXT rname[16]; /* remote network name */
- UTEXT lname[16]; /* local network name */
- UTEXT rto; /* rec timeout in 500 ms incs - 0 forever */
- UTEXT sto; /* send timeout - same */
- UCOUNT (far *anr)(); /* ptr to asynch cmd complete routine */
- UTEXT lana; /* netbios # */
- UTEXT doneflag; /* 0xff when cmd in prog, != 0xff when done */
- UTEXT res[14]; /* not used */
- } NCB;
-
- /*
- * Command Codes
- */
-
- #define NCBanr 0x80 /* or'd with cmd code for async mode */
-
- #define NCBcall 0x10 /* make session */
- #define NCBlisten 0x11 /* listen for make session */
- #define NCBhangup 0x12 /* terminate session */
- #define NCBsend 0x14 /* send session data */
- #define NCBreceive 0x15 /* receive session data */
- #define NCBrecvany 0x16 /* receive for any session under name */
- #define NCBsendtwo 0x17 /* concat two blocks and send */
- #define NCBsenddgrm 0x20 /* send datagram */
- #define NCBrecvdgrm 0x21 /* receive datagram */
- #define NCBsendbcst 0x22 /* send broadcast */
- #define NCBrecvbcst 0x23 /* receive broadcast */
- #define NCBaddname 0x30 /* add name */
- #define NCBdelname 0x31 /* delete name */
- #define NCBreset 0x32 /* reset netbios */
- #define NCBastatus 0x33 /* get network adapter status */
- #define NCBcstatus 0x34 /* get session status */
- #define NCBcancel 0x35 /* cancel a command */
-
- /*
- * Network Error Codes
- */
-
- #define NERRbadbuflen 0x01 /* illegal buffer length */
- #define NERRbadcmd 0x03 /* illegal NCB command */
- #define NERRcmdto 0x05 /* timed out */
- #define NERRmsgincompl 0x06 /* message incomplete */
- #define NERRinvlsn 0x08 /* invalid session id */
- #define NERRnoresrc 0x09 /* out of resources */
- #define NERRsesterm 0x0A /* session terminated */
- #define NERRcmdcanc 0x0B /* command cancelled */
- #define NERRdupname 0x0D /* duplicate name */
- #define NERRnamefull 0x0E /* name table full */
- #define NERRdelcanc 0x0F /* cmd cancled because name deleted */
- #define NERRsesfull 0x11 /* session table full */
- #define NERRcallrej 0x12 /* call rejected */
- #define NERRinvnamnum 0x13 /* invalid name number */
- #define NERRnoanswer 0x14 /* no answer on a call */
- #define NERRinvname 0x15 /* name not found */
- #define NERRnamebusy 0x16 /* name in use */
- #define NERRsesabterm 0x18 /* session terminated abnormally */
- #define NERRnameconf 0x19 /* name conflict detected */
- #define NERRintfbusy 0x21 /* interface is temporarily busy */
- #define NERRtoomnycmd 0x22 /* command table temporarily full */
- #define NERRcmdcompl 0x24 /* command completed before cancel */
- #define NERRinvcanc 0x26 /* can't cancel that command */
- #define NERRnotdoneyet 0xff /* error code until command completes */
-
-
-
- /***********************************
- * ADAPTER STATUS REPORTS ELEMENTS *
- ***********************************/
-
- /*
- * individual names's status within a name status report
- */
-
- typedef struct nb_insts
- {
- UTEXT name[16]; /* 0x00 name */
- UTEXT namenum; /* 0x10 name number */
- UTEXT namestat; /* 0x11 name status (INSTATxxx) */
- } NB_INSTS;
-
- /*
- * name state codes
- */
-
- #define INSTATclaiming 0 /* trying to register name */
- #define INSTATclaimed 4 /* registered name */
- #define INSTATdeclaimed 5 /* de-registered name */
- #define INSTATdupname 6 /* duplicate name */
- #define INSTATdupdeclaimed 7 /* duplicate name, dereg pending */
- #define INSTATgroupflag 0x80 /* group name flag */
-
-
- /*
- * name status report format
- */
-
- typedef struct nb_asts
- {
- UTEXT nodename[6]; /* 00 board address (permanent node name) */
- UTEXT xjmpr; /* 06 ext. jumper sts (bit 7 =jmpr w2, 6 = w1) */
- UTEXT teststs; /* 07 last test status result */
- UTEXT majversion; /* 08 major version num */
- UTEXT minversion; /* 09 minor vers */
- UCOUNT reportmins; /* 0a time of reporting period in minutes */
- UCOUNT numcrcs; /* 0c number of crc errs */
- UCOUNT numalign; /* 0e number of alignment errors */
- UCOUNT numcollision; /* 10 number of collisions */
- UCOUNT numaborts; /* 12 number of aborted transmissions */
- ULONG paksent; /* 14 number of packets sent */
- ULONG pakrecv; /* 18 number of packets received */
- UCOUNT resends; /* 1c number of retransmissions */
- UCOUNT nobuffs; /* 1e number of times out of receive buffers */
- UTEXT res1[8]; /* 20 for internal use */
- UCOUNT free_ncb; /* 28 free ncbs */
- UCOUNT max_confncb; /* 2a configured max num of ncbs */
- UCOUNT max_ncb; /* 2c maximum number of ncbs */
- UTEXT res2[4]; /* 2e */
- UCOUNT numpendses; /* 32 number of active sessions */
- UCOUNT max_confses; /* 34 configured max allowable ses's */
- UCOUNT max_ses; /* 36 max possible ses's */
- UCOUNT max_msg_size; /* 38 maximum message data size */
- UCOUNT numnames; /* 3a number of names in name table */
- NB_INSTS insts[16]; /* 3c 16 names' status */
- } NB_ASTS;
-
-
- /***********************************
- * SESSION STATUS REPORTS ELEMENTS *
- ***********************************/
-
- /*
- * sessions' status within a session status report
- */
-
- typedef struct nb_ivsts
- {
- UTEXT lsn; /* 00 local session number */
- UTEXT state; /* 01 state (IVSTATxxx) */
- UTEXT lname[16]; /* 02 local name */
- UTEXT rname[16]; /* 12 remote's name */
- UTEXT numrv; /* 22 num of receive cmds outstanding */
- UTEXT numsn; /* 23 num of send cmds outstanding */
- } NB_IVSTS;
-
- /*
- * session state codes
- */
-
- #define IVSTATlisten 1 /* listen pending */
- #define IVSTATcall 2 /* call in progress */
- #define IVSTATactive 3 /* session established */
- #define IVSTAThangup 4 /* hangup pending */
- #define IVSTAThungup 5 /* hangup completed */
- #define IVSTATaborted 6 /* session aborted */
-
- /*
- * session status report format
- */
-
- typedef struct nb_vsts
- {
- UTEXT namenum; /* 00 name num of sessions being reported */
- UTEXT numses; /* 01 num of sessions */
- UTEXT numrvdg; /* 02 num of recv dgram and rcv bcasts out */
- UTEXT numrvany; /* 04 num of recv any's outstanding */
- /***** IVSTS entries follow here, numses of them ****/
- } NB_VSTS;
-
-
- /*
- * prototypes
- */
-
- UCOUNT nb_install_check(void);
- UCOUNT nb_adapter_stat(NCB *, UTEXT, UCOUNT(far *)(),UTEXT *,NB_ASTS *,UCOUNT);
- UCOUNT nb_addname(NCB *, UTEXT, UCOUNT(far *)(), UTEXT *);
- UCOUNT nb_delname(NCB *, UTEXT, UCOUNT(far *)(), UTEXT *);
- UCOUNT nb_listen(NCB *, UTEXT, UCOUNT(far *)(),UTEXT *, UTEXT *, UTEXT, UTEXT);
- UCOUNT nb_call(NCB *, UTEXT, UCOUNT(far *)(),UTEXT *, UTEXT *, UTEXT, UTEXT);
- UCOUNT nb_send(NCB *, UTEXT, UCOUNT(far *)(), UTEXT, UTEXT *, UCOUNT);
- UCOUNT nb_recv(NCB *, UTEXT, UCOUNT(far *)(), UTEXT, UTEXT *, UCOUNT);
- UCOUNT nb_recvany(NCB *, UTEXT, UCOUNT(far *)(), UTEXT, UTEXT *, UCOUNT);
- UCOUNT nb_hangup(NCB *, UTEXT, UCOUNT(far *)(), UTEXT);
- UCOUNT nb_cancel(NCB *, NCB *);
-