Add wormhole state check function
[ric-plt/lib/rmr.git] / src / rmr / si / src / si95 / sistruct.h
1 // vim: noet sw=4 ts=4:
2 /*
3 ==================================================================================
4     Copyright (c) 2020 Nokia
5     Copyright (c) 2020 AT&T Intellectual Property.
6
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
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
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 ==================================================================================
19 */
20
21 /*
22 ***************************************************************************
23 *
24 * Mnemonic: sistruct.h
25 * Abstract: This file contains the structure definitions ncessary to support
26 *           the SI (Socket interface) routines.
27 * Date:     26 March 1995
28 * Author:   E. Scott Daniels
29 *
30 ******************************************************************************
31 */
32
33 #ifndef _sistruct_h
34 #define _sistruct_h
35
36 struct ioq_blk              //  block to queue on session when i/o waiting 
37 {
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) 
43  };
44
45 struct callback_blk         //  defines a callback routine 
46 {
47         void *cbdata;            //  pointer to be passed to the call back routine 
48         int ((*cbrtn)( ));       //  pointer to the callback routine 
49 };
50
51 struct tp_blk               //  transmission provider info block 
52 {
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 
64
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
68         long long rcvd;
69 };
70
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
75         fd_set writefds;
76         fd_set execpfds;
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
85 };
86
87 #endif