This file is indexed.

/usr/share/z88dk/include/net/tcpsock.h is in z88dk-data 1.8.ds1-10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
 *      Small C+ TCP Stack
 *
 *      Definitions for TCP Socket
 *
 *      djm 24/4/99
 *
 *	$Id: tcpsock.h,v 1.5 2002/06/09 15:13:57 dom Exp $
 */


#ifndef _NET_TCPSOCK_H
#define _NET_TCPSOCK_H

#include <net/inet.h>

/* UDP Socket */

#define UDPSOCKET struct udpsocket

UDPSOCKET {
        UDPSOCKET *next;
        u8_t      ip_type;
	pid_t	  pid;		/* Future... */
        u8_t      *errmsg;

	u8_t	  handlertype;	/* Internal/Package */
#ifdef CYBIKO
        int (*datahandler)(void *,int,ip_header_t *,udp_header_t *,UDPSOCKET *);
#else
        int (*datahandler)();
#endif
	u32_t	  timeout;
        ipaddr_t  myaddr;
        tcpport_t myport;
        ipaddr_t  hisaddr;
        tcpport_t hisport;
	u8_t	  tos;
	u8_t	  ttl;
        u16_t     recvsize;
        u8_t      *recvbuff;
	u16_t	  recvoffs;    /* How much in buffer */
	u16_t	  recvread;	/* How much read from buffer */
        u8_t      *user;       /* Some user pointers for us.. */
        u8_t      sockmode;     /* bit 0 set = ascii unset = binary */
};

#define UDPMODE_ASC     1
#define UDPMODE_CKSUM   2


/* TCP Socket */

#define TCPSOCKET struct socket
#define tcp_MAXDATA 512


TCPSOCKET {
        TCPSOCKET  *next;
        u8_t    ip_type;        /* TCP/UDP */
	pid_t	pid;		/* Future */
        u8_t    *errmsg;        /* Set on close etc */

	u8_t	handlertype;	/* Internal/package */
#ifdef CYBIKO
        int (*datahandler)(void *,int,TCPSOCKET *);
#else
        int(*datahandler)();
#endif
	u32_t	timeout;
        ipaddr_t   myaddr;
        tcpport_t  myport;
        ipaddr_t   hisaddr;
        tcpport_t  hisport;
	u8_t	  tos;
	u8_t	  ttl;
/* receive buffer stuff - this is handled via pointers because not
 * everything needs a recv buffer - only true apps, size can be
 * adjusted upwards...
 */
        i16_t   recvsize;        /* Size of recv buffer */
        u8_t    *recvbuff;
        i16_t   recvoffs;        /* how much in buffer */
        i16_t   recvread;        /* how much read from buffer */
        
        u8_t    *appptr;        /* Used by application */
        u8_t    state;

        u32_t      acknum;
        u32_t      seqnum;
        i16_t   unacked;        /* Amount of unacked data */
        u8_t    unhappy;
        u8_t    flags;
        u8_t    recent;         /* Set if recently retransmitted */
        u16_t    window;         /* His window */
/* Van Jacobson's algorithm */
        u8_t    cwindow;        /* Congestion window */
        u8_t    wwindow;
        u16_t    vj_sa;
        u16_t    vj_sd;
        u16_t    vj_last;
        u16_t    rto;
        u8_t    karn_count;
/* Retransmission timeout procedure - in clock ticks */
        u32_t    rtt_lasttran;   /* Last transmission time */
/*        u32_t    rtt_smooth; */    /* Smoothed round trip time */
/*        u32_t    rtt_delay;  */    /* Delay for next transmission */
        u32_t    rtt_time;       /* Time for next transmission */

        u16_t    mss;
       u32_t    inactive_to; 

/*
 * send buffer stuff, handling via pointers as well, we set the size
 * at the start, can resize upwards if we want, but we don't adjust
 * the size at all
 */
        u8_t    *sendbuff;      /* Where the buffer is */
        i16_t   sendsize;       /* Size of send buffer */
        i16_t   sendoffs;       /* Offset in buffer */
};
    

/* TCP flags */

#define tcp_flagFIN     0x01
#define tcp_flagSYN     0x02
#define tcp_flagRST     0x04
#define tcp_flagPUSH    0x08
#define tcp_flagACK     0x10
#define tcp_flagURG     0x20



/*
 * TCP states, from tcp manual.
 * Note: close-wait state is bypassed by automatically closing a connection
 *       when a FIN is received.  This is easy to undo.
 */
#define tcp_stateNONE    0      /* bound */
#define tcp_stateLISTEN  1      /* listening for connection */
#define tcp_stateSYNSENT 2      /* syn sent, active open */
#define tcp_stateSYNREC  3      /* syn received, synack+syn sent. */
#define tcp_stateESTAB   4      /* established */
#define tcp_stateESTCL   5
#define tcp_stateFINWT1  6      /* sent FIN */
#define tcp_stateFINWT2  7      /* sent FIN, received FINACK */
#define tcp_stateCLOSEWT 8
#define tcp_stateCLOSING 9      /* sent FIN, received FIN (waiting for FINACK) */
#define tcp_stateLASTACK 10      /* fin received, finack+fin sent */
#define tcp_stateTIMEWT  11      /* dally after sending final FINACK */
#define tcp_stateCLOSEMSL 12
#define tcp_stateCLOSED  13      /* finack received */




#endif /* _NET_TCPSOCK_H */