|
|
1.1 ! root 1: #ifndef _CHCONSTANTS_ ! 2: #define _CHCONSTANTS_ ! 3: /* ! 4: * This file contains constants defined in the basic chaos protocol, ! 5: * including the built-in RFC's (status, etc.) ! 6: */ ! 7: #define CHMAXPKT 488 ! 8: #define CHMAXDATA 488 /* Maximum data per packet */ ! 9: #define CHSTATNAME 32 /* Length of node name in STATUS protocol */ ! 10: #define CHDRWSIZE 5 /* Default receive window size */ ! 11: #define CHNSUBNET 10 /* Number of subnets available */ ! 12: #define CHSP (040) ! 13: #define CHNL (0200|'\r') ! 14: #define CHTAB (0200|'\t') ! 15: #define CHFF (0200|'\f') ! 16: #define CHBS (0200|'\b') ! 17: #define CHLF (0200|'\n') ! 18: /* ! 19: * These are the connection states ! 20: */ ! 21: #define CSCLOSED 0 /* Closed */ ! 22: #define CSLISTEN 1 /* Listening */ ! 23: #define CSRFCRCVD 2 /* RFC received (used?) */ ! 24: #define CSRFCSENT 3 /* RFC sent */ ! 25: #define CSOPEN 4 /* Open */ ! 26: #define CSLOST 5 /* Broken by receipt of a LOS */ ! 27: #define CSINCT 6 /* Broken by incomplete transmission */ ! 28: #define CSBRDSENT 7 /* BRD sent */ ! 29: #define CSSTARTING 8 /* UNIX fd open, but conn not yet initted */ ! 30: ! 31: /* ! 32: * These are the packet opcode types ! 33: */ ! 34: #define RFCOP 001 /* Request for connection */ ! 35: #define OPNOP 002 /* Open connection */ ! 36: #define CLSOP 003 /* Close connection */ ! 37: #define FWDOP 004 /* Forward this packet */ ! 38: #define ANSOP 005 /* Answer packet */ ! 39: #define SNSOP 006 /* Sense packet */ ! 40: #define STSOP 007 /* Status packet */ ! 41: #define RUTOP 010 /* Routing information packet */ ! 42: #define LOSOP 011 /* Losing connection packet */ ! 43: #define LSNOP 012 /* Listen packet (never transmitted) */ ! 44: #define MNTOP 013 /* Maintenance packet */ ! 45: #define EOFOP 014 /* End of File packet */ ! 46: #define UNCOP 015 /* Uncontrolled data packet */ ! 47: #define BRDOP 016 /* Broadcast request */ ! 48: #define MAXOP 017 /* Maximum legal opcode */ ! 49: #define DATOP 0200 /* Ordinary character data */ ! 50: #define DWDOP 0300 /* 16 bit word data */ ! 51: ! 52: /* ! 53: * Modes available in CHIOCSMODE call. ! 54: */ ! 55: #define CHSTREAM 1 ! 56: #define CHRECORD 2 ! 57: ! 58: /* ! 59: * Chaos device IOCTL codes ! 60: */ ! 61: #define _IO(x,y) (('x'<<8)|y) ! 62: #define _IOW(x,y,t) _IO(x,y) ! 63: #define _IOR(x,y,t) _IO(x,y) ! 64: ! 65: #define CHIOCFLUSH _IO(c,4) ! 66: #define CHIOCGSTAT _IOR(c,5,struct chstatus) ! 67: #define CHIOCSWAIT _IO(c,6) ! 68: #define CHIOCANSWER _IO(c,7) ! 69: #define CHIOCREJECT _IOW(c,8,struct chreject) ! 70: #define CHIOCACCEPT _IO(c,9) ! 71: #define CHIOCOWAIT _IO(c,10) ! 72: #define CHIOCRPKT _IOR(c,16,struct chrpkt) ! 73: ! 74: /* ! 75: * Unmatched RFC server IOCTL codes ! 76: */ ! 77: ! 78: #define CHIOCADDR _IOW(c,11,int) ! 79: #define CHIOCNAME _IOW(c,12,struct chstatname) ! 80: ! 81: /* ! 82: * Error codes ! 83: */ ! 84: ! 85: #define CHNOCONN -1 ! 86: ! 87: ! 88: #define CHAOSDEV "/dev/ch/ch" ! 89: ! 90: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.