The Sequence Toolkit
www.sequence-toolkit.com
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
stk_data_flow.h
Go to the documentation of this file.
1
10
#ifndef STK_DATA_FLOW_H
11
#define STK_DATA_FLOW_H
12
#include "
stk_env.h
"
13
#include "
stk_common.h
"
14
#include "
stk_sequence.h
"
15
#include <sys/types.h>
16
#include <sys/socket.h>
17
#include <arpa/inet.h>
18
#include <netinet/in.h>
19
#include <netinet/tcp.h>
20
25
typedef
struct
stk_data_flow_stct
stk_data_flow_t
;
31
typedef
stk_uint64
stk_data_flow_id
;
32
34
typedef
stk_data_flow_t
*(*stk_create_data_flow_t)(
stk_env_t
*env,
char
*name,
stk_uint64
id,
stk_options_t
*options);
36
typedef
stk_ret
(*
stk_destroy_data_flow_t
)(
stk_data_flow_t
*flow);
38
typedef
stk_ret
(*
stk_data_flow_send_t
)(
stk_data_flow_t
*flow,
stk_sequence_t
*data_sequence,
stk_uint64
flags);
40
typedef
stk_sequence_t
*(*stk_data_flow_rcv_t)(
stk_data_flow_t
*df,
stk_sequence_t
*data_sequence,
stk_uint64
flags);
42
typedef
stk_ret
(*
stk_data_flow_identifying_ip_t
)(
stk_data_flow_t
*flow,
struct
sockaddr *data_flow_id,socklen_t addrlen);
44
typedef
stk_ret
(*
stk_data_flow_buffered_t
)(
stk_data_flow_t
*flow);
46
typedef
char
* (*stk_data_flow_protocol_t)(
stk_data_flow_t
*flow);
47
53
typedef
struct
stk_data_flow_module_stct
{
54
stk_create_data_flow_t
create_data_flow
;
55
stk_destroy_data_flow_t
destroy_data_flow
;
56
stk_data_flow_send_t
data_flow_send
;
57
stk_data_flow_rcv_t
data_flow_rcv
;
58
stk_data_flow_identifying_ip_t
data_flow_id_ip
;
59
stk_data_flow_buffered_t
data_flow_buffered
;
60
stk_data_flow_protocol_t
data_flow_protocol
;
61
}
stk_data_flow_module_t
;
62
63
67
typedef
void (*
stk_data_flow_destroyed_cb
)(
stk_data_flow_t
*flow,
stk_data_flow_id
id);
71
typedef
void (*
stk_data_flow_fd_created_cb
)(
stk_data_flow_t
*flow,
stk_data_flow_id
id,
int
fd);
75
typedef
void (*
stk_data_flow_fd_destroyed_cb
)(
stk_data_flow_t
*flow,
stk_data_flow_id
id,
int
fd);
76
77
/* Passed to stk_alloc_data_flow() and returned by stk_get_data_flow_type() */
78
#define STK_TCP_SERVER_FLOW 1
79
#define STK_TCP_CLIENT_FLOW 2
80
#define STK_RAWUDP_LISTENER_FLOW 3
81
#define STK_RAWUDP_CLIENT_FLOW 4
82
#define STK_UDP_LISTENER_FLOW 5
83
#define STK_UDP_CLIENT_FLOW 6
84
#define STK_TCP_ACCEPTED_FLOW 7
86
typedef struct stk_protocol_def_stct
87
{
88
char
protocol[16];
89
char
ip[64];
90
char
port[6];
91
char
name[64];
/* name of IP/Port info - TBD */
92
}
stk_protocol_def_t
;
93
#endif
94
Sequence Toolkit
API, Wed Apr 15 2015 22:32:53