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 ******************************************************************************
33 struct ioq_blk // block to queue on session when i/o waiting
35 struct ioq_blk *next; // next block in the queue
36 char *data; // pointer to the data buffer
37 unsigned int dlen; // data length
38 void *addr; // address to send to (udp only)
39 int alen; // size of address struct (udp)
42 struct callback_blk // defines a callback routine
44 void *cbdata; // pointer to be passed to the call back routine
45 int ((*cbrtn)( )); // pointer to the callback routine
48 struct tp_blk // transmission provider info block
50 struct tp_blk *next; // chain pointer
51 struct tp_blk *prev; // back pointer
52 int fd; // open file descriptor
53 int flags; // flags about the session / fd
54 int type; // connection type SOCK_DGRAM/SOCK_STREAM
55 int family; // address family AF_* constants from system headers
56 struct sockaddr *addr; // connection local address
57 struct sockaddr *paddr; // session partner's address
58 int palen; // length of the struct referenced by paddr (connect needs)
59 struct ioq_blk *squeue; // queue to send to partner when it wont block
60 struct ioq_blk *sqtail; // last in queue to eliminate the need to search
62 // a few counters for stats
63 long long qcount; // number of messages that waited on the queue
64 long long sent; // send/receive counts
68 struct ginfo_blk { // general info block (context)
69 unsigned int magicnum; // magic number that ids a valid block
70 struct tp_blk *tplist; // pointer at tp block list
71 fd_set readfds; // select/poll file des lists
74 fd_set readfds_qs; // quick set read/write/except fd sets
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