## diffname port/ipdat.h 1991/0424 ## diff -e /dev/null /n/bootesdump/1991/0424/sys/src/9/port/ipdat.h 0a typedef struct Ipconv Ipconv; typedef struct Ipifc Ipifc; typedef struct Fragq Fragq; typedef struct Ipfrag Ipfrag; typedef ulong Ipaddr; typedef struct Arpcache Arpcache; typedef ushort Port; typedef struct Udphdr Udphdr; typedef struct Etherhdr Etherhdr; typedef struct Reseq Reseq; typedef struct Tcp Tcp; typedef struct Tcpctl Tcpctl; typedef struct Tcphdr Tcphdr; typedef struct Timer Timer; struct Etherhdr { #define ETHER_HDR 14 uchar d[6]; uchar s[6]; uchar type[2]; /* Now we have the ip fields */ #define ETHER_IPHDR 20 uchar vihl; /* Version and header length */ uchar tos; /* Type of service */ uchar length[2]; /* packet length */ uchar id[2]; /* Identification */ uchar frag[2]; /* Fragment information */ uchar ttl; /* Time to live */ uchar proto; /* Protocol */ uchar cksum[2]; /* Header checksum */ uchar src[4]; /* Ip source */ uchar dst[4]; /* Ip destination */ }; /* Ethernet packet types */ #define ET_IP 0x0800 /* A userlevel data gram */ struct Udphdr { #define UDP_EHSIZE 22 uchar d[6]; /* Ethernet destination */ uchar s[6]; /* Ethernet source */ uchar type[2]; /* Ethernet packet type */ uchar vihl; /* Version and header length */ uchar tos; /* Type of service */ uchar length[2]; /* packet length */ uchar id[2]; /* Identification */ uchar frag[2]; /* Fragment information */ /* Udp pseudo ip really starts here */ #define UDP_PHDRSIZE 12 #define UDP_HDRSIZE 20 uchar Unused; uchar udpproto; /* Protocol */ uchar udpplen[2]; /* Header plus data length */ uchar udpsrc[4]; /* Ip source */ uchar udpdst[4]; /* Ip destination */ uchar udpsport[2]; /* Source port */ uchar udpdport[2]; /* Destination port */ uchar udplen[2]; /* data length */ uchar udpcksum[2]; /* Checksum */ }; #define TCP_PKT (TCP_EHSIZE+TCP_IPLEN+TCP_PHDRSIZE) struct Tcphdr { #define TCP_EHSIZE 14 uchar d[6]; /* Ethernet destination */ uchar s[6]; /* Ethernet source */ uchar type[2]; /* Ethernet packet type */ #define TCP_IPLEN 8 uchar vihl; /* Version and header length */ uchar tos; /* Type of service */ uchar length[2]; /* packet length */ uchar id[2]; /* Identification */ uchar frag[2]; /* Fragment information */ #define TCP_PHDRSIZE 12 uchar Unused; uchar proto; uchar tcplen[2]; uchar tcpsrc[4]; uchar tcpdst[4]; #define TCP_HDRSIZE 20 uchar tcpsport[2]; uchar tcpdport[2]; uchar tcpseq[4]; uchar tcpack[4]; uchar tcpflag[2]; uchar tcpwin[2]; uchar tcpcksum[2]; uchar tcpurg[2]; /* Options segment */ uchar tcpopt[2]; uchar tcpmss[2]; }; struct Timer { Timer *next; Timer *prev; int state; int start; int count; void (*func)(void*); void *arg; }; struct Tcpctl { QLock; uchar state; /* Connection state */ uchar type; /* Listening or active connection */ uchar code; /* Icmp code */ struct { int una; /* Unacked data pointer */ int nxt; /* Next sequence expected */ int ptr; /* Data pointer */ ushort wnd; /* Tcp send window */ int up; /* Urgent data pointer */ int wl1; int wl2; } snd; int iss; ushort cwind; ushort ssthresh; int resent; struct { int nxt; ushort wnd; int up; } rcv; int irs; ushort mss; int rerecv; ushort window; int max_snd; int last_ack; char backoff; char flags; char tos; Block *rcvq; ushort rcvcnt; Block *rcvoobq; ushort rcvoobcnt; Block *sndq; /* List of data going out */ ushort sndcnt; /* Amount of data in send queue */ Block *sndoobq; /* List of blocks going oob */ ushort sndoobcnt; /* Size of out of band queue */ ushort oobmark; /* Out of band sequence mark */ char oobflags; /* Out of band data flags */ Reseq *reseq; /* Resequencing queue */ Timer timer; Timer acktimer; /* Acknoledge timer */ Timer rtt_timer; /* Round trip timer */ int rttseq; /* Round trip sequence */ int srtt; /* Shortened round trip */ int mdev; /* Mean deviation of round trip */ }; struct Tcp { Port source; Port dest; int seq; int ack; char flags; ushort wnd; ushort up; ushort mss; }; struct Reseq { Reseq *next; Tcp seg; Block *bp; ushort length; char tos; }; /* An ip interface used for UDP/TCP/ARP/ICMP */ struct Ipconv { QLock; /* Ref count lock */ int ref; Qinfo *stproto; /* Stream protocol for this device */ Ipaddr dst; /* Destination from connect */ Port psrc; /* Source port */ Port pdst; /* Destination port */ uchar ptype; /* Source port type */ Ipifc *ipinterface; /* Ip protocol interface */ Queue *readq; /* Pointer to upstream read q */ QLock listenq; /* List of people waiting incoming cons */ Rendez listenr; /* Some where to sleep while waiting */ Ipconv *listen; char err; /* Async protocol error */ int backlog; /* Maximum number of waiting connections */ int curlog; /* Number of waiting connections */ int contype; Tcpctl tcpctl; /* Tcp control block */ }; #define MAX_TIME 100000000 /* Forever */ #define TCP_ACK 200 /* Timed ack sequence every 200ms */ #define URG 0x20 #define ACK 0x10 #define PSH 0x08 #define RST 0x04 #define SYN 0x02 #define FIN 0x01 #define EOL_KIND 0 #define NOOP_KIND 1 #define MSS_KIND 2 #define MSS_LENGTH 4 #define MSL2 10 #define MSPTICK 200 #define DEF_MSS 1024 #define DEF_RTT 1000 #define TCPOOB_HADDATA 1 #define TCPOOB_HAVEDATA 2 #define TCP_PASSIVE 0 #define TCP_ACTIVE 1 #define MAXBACKOFF 5 #define FORCE 1 #define CLONE 2 #define RETRAN 4 #define ACTIVE 8 #define SYNACK 16 #define AGAIN 8 #define DGAIN 4 #define TIMER_STOP 0 #define TIMER_RUN 1 #define TIMER_EXPIRE 2 #define set_timer(t,x) (((t)->start) = (x)/MSPTICK) #define dur_timer(t) ((t)->start) #define read_timer(t) ((t)->count) #define run_timer(t) ((t)->state == TIMER_RUN) enum { CLOSED = 0, LISTEN, SYN_SENT, SYN_RECEIVED, ESTABLISHED, FINWAIT1, FINWAIT2, CLOSE_WAIT, CLOSING, LAST_ACK, TIME_WAIT }; /* * Ip interface structure. We have one for each active protocol driver */ struct Ipifc { QLock; int ref; uchar protocol; /* Ip header protocol number */ char name[NAMELEN]; /* Protocol name */ void (*iprcv) (Ipconv *, Block *); /* Receive demultiplexor */ Ipconv *connections; /* Connection list */ int maxmtu; /* Maximum transfer unit */ int minmtu; /* Minumum tranfer unit */ int hsize; /* Media header size */ Lock; }; struct Fragq { QLock; Block *blist; Fragq *next; Ipaddr src; Ipaddr dst; ushort id; }; struct Ipfrag { ushort foff; ushort flen; }; struct Arpcache { uchar status; /* Entry status */ uchar type; /* Entry type */ Ipaddr ip; /* Host byte order */ uchar eip[4]; /* Network byte order */ uchar et[6]; /* Ethernet address for this ip */ int age; /* Entry timeout */ Arpcache *hash; Arpcache **hashhd; Arpcache *frwd; Arpcache *prev; }; #define ARP_FREE 0 #define ARP_OK 1 #define ARP_ASKED 2 #define ARP_TEMP 0 #define ARP_PERM 1 #define Arphashsize 32 #define ARPHASH(p) arphash[((p[2]^p[3])%Arphashsize)] #define ARP_WAITMS 2500 /* Wait for arp replys */ #define IP_VER 0x40 /* Using IP version 4 */ #define IP_HLEN 0x05 /* Header length in characters */ #define IP_DF 0x4000 /* Don't fragment */ #define IP_MF 0x2000 /* More fragments */ #define ICMP_ECHOREPLY 0 /* Echo Reply */ #define ICMP_UNREACH 3 /* Destination Unreachable */ #define ICMP_SOURCEQUENCH 4 /* Source Quench */ #define ICMP_REDIRECT 5 /* Redirect */ #define ICMP_ECHO 8 /* Echo Request */ #define ICMP_TIMXCEED 11 /* Time-to-live Exceeded */ #define ICMP_PARAMPROB 12 /* Parameter Problem */ #define ICMP_TSTAMP 13 /* Timestamp */ #define ICMP_TSTAMPREPLY 14 /* Timestamp Reply */ #define ICMP_IREQ 15 /* Information Request */ #define ICMP_IREQREPLY 16 /* Information Reply */ /* Sizes */ #define IP_MAX 8192 /* Maximum Internet packet size */ #define UDP_MAX (IP_MAX-ETHER_IPHDR) /* Maximum UDP datagram size */ #define UDP_DATMAX (UDP_MAX-UDP_HDRSIZE) /* Maximum amount of udp data */ /* Protocol numbers */ #define IP_UDPPROTO 17 #define IP_TCPPROTO 6 /* Protocol port numbers */ #define PORTALLOC 5000 /* First automatic allocated port */ #define PRIVPORTALLOC 600 /* First priveleged port allocated */ #define PORTMAX 30000 /* Last port to allocte */ /* Stuff to go in funs.h someday */ Ipifc *newipifc(uchar, void (*)(Ipconv *, Block*), Ipconv *, int, int, int, char*); void closeipifc(Ipifc*); ushort ip_csum(uchar*); int arp_lookup(uchar*, uchar*); Ipaddr ipparse(char*); void hnputs(uchar*, ushort); void hnputl(uchar*, ulong); ulong nhgetl(uchar*); ushort nhgets(uchar*); ushort ptcl_csum(Block*bp, int, int); void ppkt(Block*); void udprcvmsg(Ipconv *, Block*); Block *btrim(Block*, int, int); Block *ip_reassemble(int, Block*, Etherhdr*); Ipconv *portused(Ipconv *, Port); Port nextport(Ipconv *, Port); void arp_enter(Arpentry*, int); void arp_flush(void); int arp_delete(char*); void arplinkhead(Arpcache*); Fragq *ipfragallo(void); void ipfragfree(Fragq*); void iproute(uchar*, uchar*); void initfrag(int); Block *copyb(Block*, int); int ntohtcp(Tcp*, Block**); void reset(Ipaddr, Ipaddr, char, ushort, Tcp*); void proc_syn(Ipconv*, char, Tcp*); void send_syn(Tcpctl*); void tcp_output(Ipconv*); int seq_within(int, int, int); void update(Ipconv *, Tcp *); int trim(Tcpctl *, Tcp *, Block **, ushort *); void add_reseq(Tcpctl *, char, Tcp *, Block *, ushort); void close_self(Ipconv *, int); int seq_gt(int, int); void appendb(Block **, Block *); Ipconv *ip_conn(Ipconv *, Port, Port, Ipaddr dest, char proto); void ipmkdir(Qinfo *, Dirtab *, Ipconv *); int inb_window(Tcpctl *, int); Block *htontcp(Tcp *, Block *, Tcphdr *); void start_timer(Timer *); void stop_timer(Timer *); int copyupb(Block **, uchar *, int); void init_tcpctl(Ipconv *); void close_self(Ipconv *, int); int iss(void); int seq_within(int, int, int); int seq_lt(int, int); int seq_le(int, int); int seq_gt(int, int); int seq_ge(int, int); void setstate(Ipconv *, char); void tcpackproc(void*); Block *htontcp(Tcp *, Block *, Tcphdr *); int ntohtcp(Tcp *, Block **); void extract_oob(Block **, Block **, Tcp *); void get_reseq(Tcpctl *, char *, Tcp *, Block **, ushort *); void state_upcall(Ipconv*, char oldstate, char newstate); int backoff(int); int dupb(Block **, Block *, int, int); void tcp_input(Ipconv *, Block *); void tcprcvwin(Ipconv *); void open_tcp(Ipconv *, int, ushort, char); void tcpflow(void*); void tcp_timeout(void *); void tcp_acktimer(void *); Ipconv *ipclonecon(Chan *); void iplisten(Chan *, Ipconv *, Ipconv *); #define fmtaddr(xx) (xx>>24)&0xff,(xx>>16)&0xff,(xx>>8)&0xff,xx&0xff #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define BLKIP(xp) ((Etherhdr *)((xp)->rptr)) #define BLKFRAG(xp) ((Ipfrag *)((xp)->rptr)) #define PREC(x) ((x)>>5 & 7) #define WORKBUF 64 extern Ipaddr Myip; extern Ipaddr Mymask; extern Ipaddr classmask[4]; extern Ipconv *ipconv[]; extern char *tcpstate[]; extern Rendez tcpflowr; extern Qinfo tcpinfo; extern Qinfo ipinfo; extern Qinfo udpinfo; . ## diffname port/ipdat.h 1991/0705 ## diff -e /n/bootesdump/1991/0424/sys/src/9/port/ipdat.h /n/bootesdump/1991/0705/sys/src/9/port/ipdat.h 250a #define Nreseq 64 . ## diffname port/ipdat.h 1991/1012 ## diff -e /n/bootesdump/1991/0705/sys/src/9/port/ipdat.h /n/bootesdump/1991/1012/sys/src/9/port/ipdat.h 442a extern Qinfo ilinfo; . 347a #define IP_ILPROTO 190 /* I have no idea */ . 343a #define IL_DATMAX (IP_MAX-IL_HDRSIZE) /* Maximum IL data in one ip packet */ . 313a . 302c struct Arpcache { . 300c }; . 297c struct Ipfrag { . 295c }; . 288c struct Fragq { . 275c struct Ipifc { . 270c }; . 258c enum { . 210c union { Tcpctl tcpctl; /* Tcp control block */ Ilcb ilctl; /* Il control block */ }; . 189c struct Ipconv { . 186c }; . 180c struct Reseq { . 178c }; . 169c struct Tcp { . 113c struct Tcpctl { . 111c }; . 103c struct Timer { . 99c }; . 67c struct Tcphdr { . 64a struct Ilhdr { #define IL_EHSIZE 22 uchar d[6]; /* Ethernet destination */ uchar s[6]; /* Ethernet source */ uchar type[2]; /* Ethernet packet type */ uchar vihl; /* Version and header length */ uchar tos; /* Type of service */ uchar length[2]; /* packet length */ uchar id[2]; /* Identification */ uchar frag[2]; /* Fragment information */ #define IL_HDRSIZE 16 uchar ilsum[2]; /* Checksum including header */ uchar illen[2]; /* Packet length */ uchar iltype; /* Packet type */ uchar ilspec; /* Special */ uchar ilsrc[2]; /* Src port */ uchar ildst[2]; /* Dst port */ uchar ilid[4]; /* Sequence id */ uchar ilack[4]; /* Acked sequence */ }; struct Ilcb { int state; Block *unacked; Block *unackedtail; Block *outoforder; Block *outofordertail; ulong sent; ulong recvd; ulong lastack; }; enum { Ilsync, Ildata, Ildataquery, Ilack, Ilquerey, Ilstate, }; . 40c struct Udphdr { . 16c struct Etherhdr { . 14a typedef struct Ilhdr Ilhdr; typedef struct Ilcb Ilcb; . ## diffname port/ipdat.h 1991/1013 ## diff -e /n/bootesdump/1991/1012/sys/src/9/port/ipdat.h /n/bootesdump/1991/1013/sys/src/9/port/ipdat.h 110a Ilreset, . ## diffname port/ipdat.h 1991/1014 ## diff -e /n/bootesdump/1991/1013/sys/src/9/port/ipdat.h /n/bootesdump/1991/1014/sys/src/9/port/ipdat.h 484c void tcpstart(Ipconv *, int, ushort, char); . 294a #define IL_PASSIVE 0 #define IL_ACTIVE 1 . 113a enum /* Connection state */ { Ilclosed, Ilsyncer, Ilsyncee, Ilestablished, Illistening, Ilclosing, }; . 103c enum /* Packet types */ . 100a int window; . 91c struct Ilcb /* Control block */ . 79a uchar ttl; /* Time to live */ uchar proto; /* Protocol */ uchar cksum[2]; /* Header checksum */ uchar src[4]; /* Ip source */ uchar dst[4]; /* Ip destination */ . 71c #define IL_EHSIZE 34 . ## diffname port/ipdat.h 1991/1015 ## diff -e /n/bootesdump/1991/1014/sys/src/9/port/ipdat.h /n/bootesdump/1991/1015/sys/src/9/port/ipdat.h 522a extern char *ilstate[]; . 502a void ilstart(Ipconv *, int, int); . ## diffname port/ipdat.h 1991/1019 ## diff -e /n/bootesdump/1991/1015/sys/src/9/port/ipdat.h /n/bootesdump/1991/1019/sys/src/9/port/ipdat.h 529a extern Queue *Ipoutput; . 97a Lock; . 85c #define IL_HDRSIZE 18 . ## diffname port/ipdat.h 1991/1023 ## diff -e /n/bootesdump/1991/1019/sys/src/9/port/ipdat.h /n/bootesdump/1991/1023/sys/src/9/port/ipdat.h 478a Ipconv *ipincoming(Ipconv*); . 281c int newcon; /* Flags that this is the start of a connection */ . 276d 273d 270d 266d ## diffname port/ipdat.h 1991/1024 ## diff -e /n/bootesdump/1991/1023/sys/src/9/port/ipdat.h /n/bootesdump/1991/1024/sys/src/9/port/ipdat.h 267a char ptype; /* Port type */ . 74a . 48a . ## diffname port/ipdat.h 1991/1025 ## diff -e /n/bootesdump/1991/1024/sys/src/9/port/ipdat.h /n/bootesdump/1991/1025/sys/src/9/port/ipdat.h 510a void iloutoforder(Ipconv*, Ilhdr*, Block*); . 105d ## diffname port/ipdat.h 1991/1026 ## diff -e /n/bootesdump/1991/1025/sys/src/9/port/ipdat.h /n/bootesdump/1991/1026/sys/src/9/port/ipdat.h 106a ulong start; . ## diffname port/ipdat.h 1991/1027 ## diff -e /n/bootesdump/1991/1026/sys/src/9/port/ipdat.h /n/bootesdump/1991/1027/sys/src/9/port/ipdat.h 511a void arpsendpkt(uchar*, uchar*, Queue*, Block*); . 456,458c void arpenter(Arpentry*, int); void arpflush(void); int arpdelete(char*); void pusharpq(void); . ## diffname port/ipdat.h 1991/1028 ## diff -e /n/bootesdump/1991/1027/sys/src/9/port/ipdat.h /n/bootesdump/1991/1028/sys/src/9/port/ipdat.h 382,404d 6d ## diffname port/ipdat.h 1991/1029 ## diff -e /n/bootesdump/1991/1028/sys/src/9/port/ipdat.h /n/bootesdump/1991/1029/sys/src/9/port/ipdat.h 510a extern Qinfo arpinfo; . 489d 432,436d ## diffname port/ipdat.h 1991/1101 ## diff -e /n/bootesdump/1991/1029/sys/src/9/port/ipdat.h /n/bootesdump/1991/1101/sys/src/9/port/ipdat.h 119c Ilclose, . ## diffname port/ipdat.h 1991/1102 ## diff -e /n/bootesdump/1991/1101/sys/src/9/port/ipdat.h /n/bootesdump/1991/1102/sys/src/9/port/ipdat.h 107a int timeout; . ## diffname port/ipdat.h 1991/1104 ## diff -e /n/bootesdump/1991/1102/sys/src/9/port/ipdat.h /n/bootesdump/1991/1104/sys/src/9/port/ipdat.h 270d 261c /* An ip interface used for UDP/TCP/IL */ . ## diffname port/ipdat.h 1991/1106 ## diff -e /n/bootesdump/1991/1104/sys/src/9/port/ipdat.h /n/bootesdump/1991/1106/sys/src/9/port/ipdat.h 106a ulong rstart; . ## diffname port/ipdat.h 1991/1107 ## diff -e /n/bootesdump/1991/1106/sys/src/9/port/ipdat.h /n/bootesdump/1991/1107/sys/src/9/port/ipdat.h 104c ulong next; . ## diffname port/ipdat.h 1991/1114 ## diff -e /n/bootesdump/1991/1107/sys/src/9/port/ipdat.h /n/bootesdump/1991/1114/sys/src/9/port/ipdat.h 484a void iplocalfill(Chan*, char*, int); void ipremotefill(Chan*, char*, int); void ipstatusfill(Chan*, char*, int); . 482,483c int ipclonecon(Chan *); int iplisten(Chan *); . 363a Network net; . ## diffname port/ipdat.h 1991/1115 ## diff -e /n/bootesdump/1991/1114/sys/src/9/port/ipdat.h /n/bootesdump/1991/1115/sys/src/9/port/ipdat.h 453c Ipconv *ipincoming(Ipconv*, Ipconv*); . 266a int index; . ## diffname port/ipdat.h 1991/1121 ## diff -e /n/bootesdump/1991/1115/sys/src/9/port/ipdat.h /n/bootesdump/1991/1121/sys/src/9/port/ipdat.h 439d ## diffname port/ipdat.h 1991/1124 ## diff -e /n/bootesdump/1991/1121/sys/src/9/port/ipdat.h /n/bootesdump/1991/1124/sys/src/9/port/ipdat.h 403c #define IP_MAX (32*1024) /* Maximum Internet packet size */ . 104,110c int oblks; /* Number of blocks in queue */ ulong next; /* Id of next to send */ ulong recvd; /* Last packet received */ ulong start; /* Local start id */ ulong rstart; /* Remote start id */ int timeout; /* Time out counter */ int slowtime; /* Slow time counter */ int fasttime; /* Retransmission timer */ int acktime; /* Acknowledge timer */ int rtt; /* Average round trip time */ ulong rttack; /* The ack we are waiting for */ ulong ackms; /* Time we issued */ int window; /* Maximum receive window */ . 102a QLock outo; /* Out of order packet queue */ . 99,100c int state; /* Connection state */ QLock ackq; /* Unacknowledged queue */ . ## diffname port/ipdat.h 1991/1126 ## diff -e /n/bootesdump/1991/1124/sys/src/9/port/ipdat.h /n/bootesdump/1991/1126/sys/src/9/port/ipdat.h 501a int ipforme(uchar*); . 463d 378d 281a Network *net; /* user level network interface */ . 240,244d 234,236d ## diffname port/ipdat.h 1991/1204 ## diff -e /n/bootesdump/1991/1126/sys/src/9/port/ipdat.h /n/bootesdump/1991/1204/sys/src/9/port/ipdat.h 312c #define DEF_MSS 512 . ## diffname port/ipdat.h 1991/1205 ## diff -e /n/bootesdump/1991/1204/sys/src/9/port/ipdat.h /n/bootesdump/1991/1205/sys/src/9/port/ipdat.h 314,315d 312c #define DEF_MSS 1024 . ## diffname port/ipdat.h 1991/1216 ## diff -e /n/bootesdump/1991/1205/sys/src/9/port/ipdat.h /n/bootesdump/1991/1216/sys/src/9/port/ipdat.h 379a ulong age; . ## diffname port/ipdat.h 1991/12171 ## diff -e /n/bootesdump/1991/1216/sys/src/9/port/ipdat.h /n/bootesdump/1991/12171/sys/src/9/port/ipdat.h 342,352c Closed = 0, Listen, Syn_sent, Syn_received, Established, Finwait1, Finwait2, Close_wait, Closing, Last_ack, Time_wait . 340c enum /* Tcp connection states */ . ## diffname port/ipdat.h 1992/0103 ## diff -e /n/bootesdump/1991/12171/sys/src/9/port/ipdat.h /n/bootesdump/1992/0103/sys/src/9/port/ipdat.h 108a Lock nxl; . ## diffname port/ipdat.h 1992/0105 ## diff -e /n/bootesdump/1992/0103/sys/src/9/port/ipdat.h /n/bootesdump/1992/0105/sys/src/9/port/ipdat.h 107d ## diffname port/ipdat.h 1992/0107 ## diff -e /n/bootesdump/1992/0105/sys/src/9/port/ipdat.h /n/bootesdump/1992/0107/sys/src/9/port/ipdat.h 440c void ipfragfree(Fragq*, int); . ## diffname port/ipdat.h 1992/0111 ## diff -e /n/bootesdump/1992/0107/sys/src/9/port/ipdat.h /n/bootesdump/1992/0111/sys/src/9/port/ipdat.h 463d 452c void close_self(Ipconv *, char []); . 284c char *err; /* Async protocol error */ . ## diffname port/ipdat.h 1992/0128 ## diff -e /n/bootesdump/1992/0111/sys/src/9/port/ipdat.h /n/bootesdump/1992/0128/sys/src/9/port/ipdat.h 438c Port nextport(Ipconv *, int); . 244a struct Tcpctl { QLock; struct Tctl; }; . 199d 197c struct Tctl . ## diffname port/ipdat.h 1992/0130 ## diff -e /n/bootesdump/1992/0128/sys/src/9/port/ipdat.h /n/bootesdump/1992/0130/sys/src/9/port/ipdat.h 501c #define BLKFRAG(xp) ((Ipfrag *)((xp)->base)) . ## diffname port/ipdat.h 1992/0213 ## diff -e /n/bootesdump/1992/0130/sys/src/9/port/ipdat.h /n/bootesdump/1992/0213/sys/src/9/port/ipdat.h 518a /* offsets into Myip */ enum { Myself= 0, Mybcast= 1, Mynet= 3, Mysubnet= 5, }; . 506c extern Ipaddr Myip[4]; . ## diffname port/ipdat.h 1992/0214 ## diff -e /n/bootesdump/1992/0213/sys/src/9/port/ipdat.h /n/bootesdump/1992/0214/sys/src/9/port/ipdat.h 506c extern Ipaddr Myip[7]; . 495a void ipsetaddrs(void); . ## diffname port/ipdat.h 1992/0301 ## diff -e /n/bootesdump/1992/0214/sys/src/9/port/ipdat.h /n/bootesdump/1992/0301/sys/src/9/port/ipdat.h 117a int querytime; /* Query timer */ int deathtime; /* Time to kill connection */ . ## diffname port/ipdat.h 1992/0303 ## diff -e /n/bootesdump/1992/0301/sys/src/9/port/ipdat.h /n/bootesdump/1992/0303/sys/src/9/port/ipdat.h 249a Rendez syner; . 100a Rendez syncer; /* where syncer waits for a connect */ . ## diffname port/ipdat.h 1992/0304 ## diff -e /n/bootesdump/1992/0303/sys/src/9/port/ipdat.h /n/bootesdump/1992/0304/sys/src/9/port/ipdat.h 513a extern Ipaddr Mynetmask; . ## diffname port/ipdat.h 1992/0307 ## diff -e /n/bootesdump/1992/0304/sys/src/9/port/ipdat.h /n/bootesdump/1992/0307/sys/src/9/port/ipdat.h 377a ulong chkerrs; /* checksum errors */ ulong tx; ulong rx; . ## diffname port/ipdat.h 1992/0310 ## diff -e /n/bootesdump/1992/0307/sys/src/9/port/ipdat.h /n/bootesdump/1992/0310/sys/src/9/port/ipdat.h 379,380d 345,346d 247a . ## diffname port/ipdat.h 1992/0313 ## diff -e /n/bootesdump/1992/0310/sys/src/9/port/ipdat.h /n/bootesdump/1992/0313/sys/src/9/port/ipdat.h 528c enum { . 501a int ipconbusy(Ipconv*); . ## diffname port/ipdat.h 1992/0320 ## diff -e /n/bootesdump/1992/0313/sys/src/9/port/ipdat.h /n/bootesdump/1992/0320/sys/src/9/port/ipdat.h 321c #define MSPTICK 100 . ## diffname port/ipdat.h 1992/0321 ## diff -e /n/bootesdump/1992/0320/sys/src/9/port/ipdat.h /n/bootesdump/1992/0321/sys/src/9/port/ipdat.h 238c ulong sndcnt; /* Amount of data in send queue */ . 235c ulong rcvcnt; . ## diffname port/ipdat.h 1992/0325 ## diff -e /n/bootesdump/1992/0321/sys/src/9/port/ipdat.h /n/bootesdump/1992/0325/sys/src/9/port/ipdat.h 472d 470c int pullb(Block **, int); . 431c /* IP function declarations */ . ## diffname port/ipdat.h 1992/0414 ## diff -e /n/bootesdump/1992/0325/sys/src/9/port/ipdat.h /n/bootesdump/1992/0414/sys/src/9/port/ipdat.h 297c Ipconv *newcon; /* Flags that this is the start of a connection */ . ## diffname port/ipdat.h 1992/0416 ## diff -e /n/bootesdump/1992/0414/sys/src/9/port/ipdat.h /n/bootesdump/1992/0416/sys/src/9/port/ipdat.h 501a void tcpflushincoming(Ipconv*); . 253a struct Tctl; . 252d 234c Blist rcvq; . ## diffname port/ipdat.h 1992/0606 ## diff -e /n/bootesdump/1992/0416/sys/src/9/port/ipdat.h /n/bootesdump/1992/0606/sys/src/9/port/ipdat.h 343c #define Nreseq 128 . ## diffname port/ipdat.h 1992/0614 ## diff -e /n/bootesdump/1992/0606/sys/src/9/port/ipdat.h /n/bootesdump/1992/0614/sys/src/9/port/ipdat.h 424c #define IP_ILPROTO 40 . ## diffname port/ipdat.h 1992/0623 ## diff -e /n/bootesdump/1992/0614/sys/src/9/port/ipdat.h /n/bootesdump/1992/0623/sys/src/9/port/ipdat.h 282d 280a Netprot; /* stat info */ . ## diffname port/ipdat.h 1992/0625 ## diff -e /n/bootesdump/1992/0623/sys/src/9/port/ipdat.h /n/bootesdump/1992/0625/sys/src/9/port/ipdat.h 531,534c Myself = 0, Mybcast = 1, Mynet = 3, Mysubnet = 5, . 511,512d 502a void tcprcvwin(Ipconv *); void tcpstart(Ipconv *, int, ushort, char); int trim(Tcpctl *, Tcp *, Block **, ushort *); void udprcvmsg(Ipconv *, Block*); void update(Ipconv *, Tcp *); . 491,501d 487,489c void tcp_output(Ipconv*); void tcp_timeout(void *); void tcpackproc(void*); . 484,485c void stop_timer(Timer *); void tcp_acktimer(void *); . 478,482c void start_timer(Timer *); . 476c int seq_le(int, int); int seq_lt(int, int); int seq_within(int, int, int); int seq_within(int, int, int); . 463,474d 456,461c int seq_ge(int, int); . 454a ushort ptcl_csum(Block*bp, int, int); int pullb(Block **, int); void reset(Ipaddr, Ipaddr, char, ushort, Tcp*); . 453c Ipconv* portused(Ipconv *, Port); void ppkt(Block*); . 441,451c int ntohtcp(Tcp *, Block **); . 437,438c void ipremotefill(Chan*, char*, int); void iproute(uchar*, uchar*); void ipsetaddrs(void); void ipstatusfill(Chan*, char*, int); Ipifc* newipifc(uchar, void (*)(Ipconv *, Block*), Ipconv *, int, int, int, char*); Port nextport(Ipconv *, int); . 435c Block* ip_reassemble(int, Block*, Etherhdr*); int ipclonecon(Chan *); int ipconbusy(Ipconv*); int ipforme(uchar*); Fragq* ipfragallo(void); void ipfragfree(Fragq*, int); Ipconv* ipincoming(Ipconv*, Ipconv*); int iplisten(Chan *); void iplocalfill(Chan*, char*, int); void ipmkdir(Qinfo *, Dirtab *, Ipconv *); . 433a int dupb(Block **, Block *, int, int); void extract_oob(Block **, Block **, Tcp *); void get_reseq(Tcpctl *, char *, Tcp *, Block **, ushort *); void hnputl(uchar*, ulong); void hnputs(uchar*, ushort); Block* htontcp(Tcp *, Block *, Tcphdr *); Block* htontcp(Tcp *, Block *, Tcphdr *); void iloutoforder(Ipconv*, Ilhdr*, Block*); void ilstart(Ipconv *, int, int); int inb_window(Tcpctl *, int); void init_tcpctl(Ipconv *); void initfrag(int); Ipconv* ip_conn(Ipconv *, Port, Port, Ipaddr dest, char proto); . 426,432c void add_reseq(Tcpctl *, char, Tcp *, Block *, ushort); int arp_lookup(uchar*, uchar*); int backoff(int); Block* btrim(Block*, int, int); void close_self(Ipconv *, char []); . 421,424c /* Protocol port numbers */ PORTALLOC = 5000, /* First automatic allocated port */ PRIVPORTALLOC = 600, /* First priveleged port allocated */ PORTMAX = 30000, /* Last port to allocte */ }; . 415,419c /* Protocol numbers */ IP_UDPPROTO = 17, IP_TCPPROTO = 6, IP_ILPROTO = 40, . 403,413c /* Sizes */ IP_MAX = (32*1024), /* Maximum Internet packet size */ UDP_MAX = (IP_MAX-ETHER_IPHDR), /* Maximum UDP datagram size */ UDP_DATMAX = (UDP_MAX-UDP_HDRSIZE),/* Maximum amount of udp data */ IL_DATMAX = (IP_MAX-IL_HDRSIZE), /* Maximum IL data in one ip packet */ . 398,401c enum { IP_VER = 0x40, /* Using IP version 4 */ IP_HLEN = 0x05, /* Header length in characters */ IP_DF = 0x4000, /* Don't fragment */ IP_MF = 0x2000, /* More fragments */ . 350c Closed = 0, . 348c enum /* Tcp connection states */ . 343,344d 339,341c TIMER_STOP = 0, TIMER_RUN = 1, TIMER_EXPIRE = 2, }; . 330,337c MAXBACKOFF = 5, FORCE = 1, CLONE = 2, RETRAN = 4, ACTIVE = 8, SYNACK = 16, AGAIN = 8, DGAIN = 4, . 325,328c TCP_PASSIVE = 0, /* Listen connection */ TCP_ACTIVE = 1, /* Outgoing connection */ IL_PASSIVE = 0, IL_ACTIVE = 1, . 319,323c MSS_LENGTH = 4, /* Mean segment size */ MSL2 = 10, MSPTICK = 100, /* Milliseconds per timer tick */ DEF_MSS = 1024, /* Default mean segment */ DEF_RTT = 1000, /* Default round trip */ . 315,317c EOL_KIND = 0, NOOP_KIND = 1, MSS_KIND = 2, . 308,313c URG = 0x20, /* Data marked urgent */ ACK = 0x10, /* Aknowledge is valid */ PSH = 0x08, /* Whole data pipe is pushed */ RST = 0x04, /* Reset connection */ SYN = 0x02, /* Pkt. is synchronise */ FIN = 0x01, /* Start close down */ . 305,306c enum { MAX_TIME = (1<<20),/* Forever */ TCP_ACK = 200, /* Timed ack sequence every 200ms */ . 300,301c Tcpctl tcpctl; /* Tcp control block */ Ilcb ilctl; /* Il control block */ . 294,297c char *err; /* Async protocol error */ int backlog; /* Maximum number of waiting connections */ int curlog; /* Number of waiting connections */ Ipconv *newcon; /* This is the start of a connection */ . 289,292c Ipifc *ipinterface; /* Ip protocol interface */ Queue *readq; /* Pointer to upstream read q */ QLock listenq; /* List of people waiting incoming cons */ Rendez listenr; /* Some where to sleep while waiting */ . 283,287c Qinfo *stproto; /* Stream protocol for this device */ Network *net; /* user level network interface */ Ipaddr dst; /* Destination from connect */ Port psrc; /* Source port */ Port pdst; /* Destination port */ . 280,281c QLock; /* Ref count lock */ Netprot; /* stat info */ . 242,246c Timer acktimer; /* Acknoledge timer */ Timer rtt_timer; /* Round trip timer */ int rttseq; /* Round trip sequence */ int srtt; /* Shortened round trip */ int mdev; /* Mean deviation of round trip */ . 240c Reseq *reseq; /* Resequencing queue */ . 237,238c Block *sndq; /* List of data going out */ ulong sndcnt; /* Amount of data in send queue */ . 234c Blist rcvq; /* Received data */ . 231,232c char flags; /* State flags */ char tos; /* Type of service */ . 229c int last_ack; /* Last acknowledege received */ . 219,223d 214a struct { int nxt; ushort wnd; int up; } rcv; . 207,213c int una; /* Unacked data pointer */ int nxt; /* Next sequence expected */ int ptr; /* Data pointer */ ushort wnd; /* Tcp send window */ int up; /* Urgent data pointer */ int wl1; int wl2; . 141c enum /* Connection state */ . 130c enum /* Packet types */ . 127c int window; /* Maximum receive window */ . 123,125c int rtt; /* Average round trip time */ ulong rttack; /* The ack we are waiting for */ ulong ackms; /* Time we issued */ . 116,121c int timeout; /* Time out counter */ int slowtime; /* Slow time counter */ int fasttime; /* Retransmission timer */ int acktime; /* Acknowledge timer */ int querytime; /* Query timer */ int deathtime; /* Time to kill connection */ . 111,114c ulong next; /* Id of next to send */ ulong recvd; /* Last packet received */ ulong start; /* Local start id */ ulong rstart; /* Remote start id */ . 107c QLock outo; /* Out of order packet queue */ . 103c QLock ackq; /* Unacknowledged queue */ . 101c Rendez syncer; /* where syncer waits for a connect */ . 99c int state; /* Connection state */ . 97c struct Ilcb /* Control block */ . 14,15c typedef struct Udphdr Udphdr; . 7,8d 5a typedef struct Ipconv Ipconv; typedef struct Ipfrag Ipfrag; typedef struct Ipifc Ipifc; . 4c typedef struct Ilcb Ilcb; typedef struct Ilhdr Ilhdr; . 1,2c typedef struct Etherhdr Etherhdr; . ## diffname port/ipdat.h 1992/0626 ## diff -e /n/bootesdump/1992/0625/sys/src/9/port/ipdat.h /n/bootesdump/1992/0626/sys/src/9/port/ipdat.h 504c extern Ipifc *ipifc[]; . 490c void udprcvmsg(Ipifc*, Block*); . 481c void tcp_input(Ipifc*, Block *); . 462c Ipconv* portused(Ipifc*, Port); . 459a ulong nhgetl(uchar*); . 456,458c Port nextport(Ipifc*, int); . 447c Ipconv* ipincoming(Ipifc*, Ipconv*); . 443a Ipconv* ipcreateconv(Ipifc*, int); . 439c void initipifc(Ipifc*, uchar, void (*)(Ipifc*, Block*), int, int, int, char*); Ipconv* ip_conn(Ipifc*, Port, Port, Ipaddr dest, char proto); . 426d 380a . 378c Lock; Ipconv **conv; /* conversations */ . 371,373c void (*iprcv) (Ipifc*, Block*); /* Receive demultiplexor */ . 369c Network; /* user level network interface */ Ipifc *next; int inited; . 362a enum { Nipconv= 512, /* max conversations per interface */ }; . 289c Ipifc *ifc; /* Ip protocol interface */ . 283,284d ## diffname port/ipdat.h 1992/0627 ## diff -e /n/bootesdump/1992/0626/sys/src/9/port/ipdat.h /n/bootesdump/1992/0627/sys/src/9/port/ipdat.h 363a Udphdrsize= 6, /* size if a to/from user Udp header */ . 293a int headers; /* include header in packet */ . ## diffname port/ipdat.h 1992/0711 ## diff -e /n/bootesdump/1992/0627/sys/src/9/port/ipdat.h /n/bootesdump/1992/0711/sys/src/9/port/ipdat.h 445,446c void initipifc(Ipifc*, uchar, void (*)(Ipifc*, Block*), int, int, int); Ipconv* ip_conn(Ipifc*, Port, Port, Ipaddr dest); . ## diffname port/ipdat.h 1992/0826 ## diff -e /n/bootesdump/1992/0711/sys/src/9/port/ipdat.h /n/bootesdump/1992/0826/sys/src/9/port/ipdat.h 432c void localclose(Ipconv *, char []); . ## diffname port/ipdat.h 1992/0903 ## diff -e /n/bootesdump/1992/0826/sys/src/9/port/ipdat.h /n/bootesdump/1992/0903/sys/src/9/port/ipdat.h 483,490c void tcpsetstate(Ipconv *, char); void tcpgo(Timer *); void tcphalt(Timer *); void tcpxstate(Ipconv*, char oldstate, char newstate); void tcpacktimer(void *); void tcpinput(Ipifc*, Block *); void tcpoutput(Ipconv*); void tcptimeout(void *); . 475c void tcpsndsyn(Tcpctl*); . ## diffname port/ipdat.h 1992/0906 ## diff -e /n/bootesdump/1992/0903/sys/src/9/port/ipdat.h /n/bootesdump/1992/0906/sys/src/9/port/ipdat.h 383d 347c enum /* Tcp connection states */ . 345c #define run_timer(t) ((t)->state == TimerON) . 338,341d 325,326c TCP_PASSIVE = 0, /* Listen connection */ TCP_ACTIVE = 1, /* Outgoing connection */ . 321,323c MSPTICK = 100, /* Milliseconds per timer tick */ DEF_MSS = 1024, /* Default mean segment */ DEF_RTT = 1000, /* Default round trip */ . 319c MSS_LENGTH = 4, /* Mean segment size */ . 308,313c URG = 0x20, /* Data marked urgent */ ACK = 0x10, /* Aknowledge is valid */ PSH = 0x08, /* Whole data pipe is pushed */ RST = 0x04, /* Reset connection */ SYN = 0x02, /* Pkt. is synchronise */ FIN = 0x01, /* Start close down */ . 304,306c enum { MAX_TIME = (1<<20), /* Forever */ TCP_ACK = 200, /* Timed ack sequence every 200ms */ . 299,300c Tcpctl tcpctl; /* Tcp control block */ Ilcb ilctl; /* Il control block */ . 292,296c char *err; /* Async protocol error */ int backlog; /* Maximum number of waiting connections */ int headers; /* include header in packet */ int curlog; /* Number of waiting connections */ Ipconv *newcon; /* This is the start of a connection */ . 287,290c Ipifc *ifc; /* Ip protocol interface */ Queue *readq; /* Pointer to upstream read q */ QLock listenq; /* List of people waiting incoming cons */ Rendez listenr; /* Some where to sleep while waiting */ . 283,285c Ipaddr dst; /* Destination from connect */ Port psrc; /* Source port */ Port pdst; /* Destination port */ . 280,281c QLock; /* Ref count lock */ Netprot; /* stat info */ . 240,246c Reseq *reseq; /* Resequencing queue */ Timer timer; /* Activity timer */ Timer acktimer; /* Acknoledge timer */ Timer rtt_timer; /* Round trip timer */ int rttseq; /* Round trip sequence */ int srtt; /* Shortened round trip */ int mdev; /* Mean deviation of round trip */ . 237,238c Block *sndq; /* List of data going out */ ulong sndcnt; /* Amount of data in send queue */ . 234,235c Blist rcvq; /* Received data */ ulong rcvcnt; /* Bytes queued for upstream */ . 220,232c int iss; /* Initial sequence number */ ushort cwind; /* Congestion window */ ushort ssthresh; /* Slow start threshold */ int resent; /* Bytes just resent */ int irs; /* Initial received squence */ ushort mss; /* Mean segment size */ int rerecv; /* Overlap of data rerecevived */ ushort window; /* Recevive window */ int max_snd; /* Max send */ int last_ack; /* Last acknowledege received */ char backoff; /* Exponential backoff counter */ char flags; /* State flags */ char tos; /* Type of service */ . 216,218c int nxt; /* Receive pointer to next byte slot */ ushort wnd; /* Receive window incoming */ int up; /* Urgent pointer */ . 207,211c int una; /* Unacked data pointer */ int nxt; /* Next sequence expected */ int ptr; /* Data pointer */ ushort wnd; /* Tcp send window */ int up; /* Urgent data pointer */ . 203,205c uchar state; /* Connection state */ uchar type; /* Listening or active connection */ uchar code; /* Icmp code */ . 189d 187a enum { TimerOFF = 0, TimerON = 1, TimerDONE = 2, }; . 41d ## diffname port/ipdat.h 1992/12051 ## diff -e /n/bootesdump/1992/0906/sys/src/9/port/ipdat.h /n/bootesdump/1992/12051/sys/src/9/port/ipdat.h 424a UNPRIVPORTALLOC = 1024, /* First unpriveleged port allocated */ . ## diffname port/ipdat.h 1992/1221 ## diff -e /n/bootesdump/1992/12051/sys/src/9/port/ipdat.h /n/bootesdump/1992/1221/sys/src/9/port/ipdat.h 242a Rendez sndr; /* process flow control */ QLock sndrlock; int sndfull; . ## diffname port/ipdat.h 1993/0218 ## diff -e /n/bootesdump/1992/1221/sys/src/9/port/ipdat.h /n/bootesdump/1993/0218/sys/src/9/port/ipdat.h 329c MSPTICK = 50, /* Milliseconds per timer tick */ . 314c TCP_ACK = 50, /* Timed ack sequence in ms */ . 233c ulong last_ack; /* Last acknowledege received */ . 220c ulong nxt; /* Receive pointer to next byte slot */ . ## diffname port/ipdat.h 1993/0220 ## diff -e /n/bootesdump/1993/0218/sys/src/9/port/ipdat.h /n/bootesdump/1993/0220/sys/src/9/port/ipdat.h 480,486c int seq_ge(ulong, ulong); int seq_gt(ulong, ulong); int seq_gt(ulong, ulong); int seq_le(ulong, ulong); int seq_lt(ulong, ulong); int seq_within(ulong, ulong, ulong); int seq_within(ulong, ulong, ulong); . 267,268c ulong seq; ulong ack; . 251c ulong rttseq; /* Round trip sequence */ . 224c ulong iss; /* Initial sequence number */ . 222c ulong up; /* Urgent pointer */ . 215,217c ulong up; /* Urgent data pointer */ ulong wl1; ulong wl2; . 211,213c ulong una; /* Unacked data pointer */ ulong nxt; /* Next sequence expected */ ulong ptr; /* Data pointer */ . ## diffname port/ipdat.h 1993/0501 ## diff -e /n/bootesdump/1993/0220/sys/src/9/port/ipdat.h /n/fornaxdump/1993/0501/sys/src/brazil/port/ipdat.h 480,486c int seq_ge(int, int); int seq_gt(int, int); int seq_gt(int, int); int seq_le(int, int); int seq_lt(int, int); int seq_within(int, int, int); int seq_within(int, int, int); . 329c MSPTICK = 100, /* Milliseconds per timer tick */ . 314c TCP_ACK = 200, /* Timed ack sequence every 200ms */ . 267,268c int seq; int ack; . 251c int rttseq; /* Round trip sequence */ . 233c int last_ack; /* Last acknowledege received */ . 224c int iss; /* Initial sequence number */ . 222c int up; /* Urgent pointer */ . 220c int nxt; /* Receive pointer to next byte slot */ . 215,217c int up; /* Urgent data pointer */ int wl1; int wl2; . 211,213c int una; /* Unacked data pointer */ int nxt; /* Next sequence expected */ int ptr; /* Data pointer */ . ## diffname port/ipdat.h 1993/0804 # deleted ## diff -e /n/fornaxdump/1993/0501/sys/src/brazil/port/ipdat.h /n/fornaxdump/1993/0804/sys/src/brazil/port/ipdat.h 1,533d