1 // vim: noet sw=4 ts=4:
3 ==================================================================================
4 Copyright (c) 2020 Nokia
5 Copyright (c) 2020 AT&T Intellectual Property.
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ==================================================================================
22 ***************************************************************************
24 * Mnemonic: sistruct.h
25 * Abstract: This file contains the structure definitions ncessary to support
26 * the SI (Socket interface) routines.
28 * Author: E. Scott Daniels
30 ******************************************************************************
36 struct ioq_blk // block to queue on session when i/o waiting
38 struct ioq_blk *next; // next block in the queue
39 char *data; // pointer to the data buffer
40 unsigned int dlen; // data length
41 void *addr; // address to send to (udp only)
42 int alen; // size of address struct (udp)
45 struct callback_blk // defines a callback routine
47 void *cbdata; // pointer to be passed to the call back routine
48 int ((*cbrtn)( )); // pointer to the callback routine
51 struct tp_blk // transmission provider info block
53 struct tp_blk *next; // chain pointer
54 struct tp_blk *prev; // back pointer
55 int fd; // open file descriptor
56 int flags; // flags about the session / fd
57 int type; // connection type SOCK_DGRAM/SOCK_STREAM
58 int family; // address family AF_* constants from system headers
59 struct sockaddr *addr; // connection local address
60 struct sockaddr *paddr; // session partner's address
61 int palen; // length of the struct referenced by paddr (connect needs)
62 struct ioq_blk *squeue; // queue to send to partner when it wont block
63 struct ioq_blk *sqtail; // last in queue to eliminate the need to search
65 // a few counters for stats
66 long long qcount; // number of messages that waited on the queue
67 long long sent; // send/receive counts
71 struct ginfo_blk { // general info block (context)
72 unsigned int magicnum; // magic number that ids a valid block
73 struct tp_blk *tplist; // pointer at tp block list
74 fd_set readfds; // select/poll file des lists
77 char *rbuf; // read buffer
78 struct callback_blk *cbtab; // pointer at the callback table
79 int fdcount; // largest fd to select on in siwait
80 int flags; // status flags
81 int tcp_flags; // connection/session flags (e.g. no delay)
82 int rbuflen; // read buffer length
83 int sierr; // our internal error number (SI_ERR_* constants)
84 struct tp_blk** tp_map; // direct fd -> tp block map