sctp_messages_types.h 1.72 KB
Newer Older
1
2
3
4
5
#ifndef SCTP_MESSAGES_TYPES_H_
#define SCTP_MESSAGES_TYPES_H_

enum sctp_state_e {
    SCTP_STATE_CLOSED,
6
    SCTP_STATE_SHUTDOWN,
Cedric Roux's avatar
   
Cedric Roux committed
7
8
    SCTP_STATE_ESTABLISHED,
    SCTP_STATE_UNREACHABLE
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
};

typedef struct {
    /* Upper layer connexion identifier */
    uint16_t         ulp_cnx_id;

    /* The port to connect to */
    uint16_t         port;
    /* Payload Protocol Identifier to use */
    uint32_t         ppid;

    /* Local address to bind to */
    net_ip_address_t local_address;
    /* Remote address to connect to */
    net_ip_address_t remote_address;
} sctp_new_association_req_t;

26
27
28
29
30
31
32
33
34
35
36
37
typedef struct {
    /* Assoc id of the new association */
    int32_t  assoc_id;

    /* The port used by remote host */
    uint16_t port;

    /* Number of streams used for this association */
    uint16_t in_streams;
    uint16_t out_streams;
} sctp_new_association_ind_t;

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
typedef struct {
    /* Upper layer connexion identifier */
    uint16_t ulp_cnx_id;

    /* SCTP Association ID */
    int32_t  assoc_id;

    /* Input/output streams */
    uint16_t out_streams;
    uint16_t in_streams;

    /* State of the association at SCTP level */
    enum sctp_state_e sctp_state;
} sctp_new_association_resp_t;

typedef struct {
54
    /* SCTP Association ID */
55
    int32_t   assoc_id;
56
57

    /* Buffer to send over SCTP */
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    uint32_t  buffer_length;
    uint8_t  *buffer;

    /* Streams on which data will be sent/received */
    uint16_t  stream;
} sctp_data_ind_t;

typedef sctp_data_ind_t sctp_data_req_t;

typedef struct {
    /* Port to listen to */
    uint16_t port;
    /* Payload protocol identifier
     * Any data receveid on PPID != will be discarded
     */
    uint32_t ppid;
} sctp_listener_register_upper_layer_t;

#endif /* SCTP_MESSAGES_TYPES_H_ */