summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip/sip_types.h
blob: f103019b7ca3938e800ed0e81e1d8e00fe2374f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* $Header: /pjproject/pjsip/src/pjsip/sip_types.h 5     6/19/05 6:12p Bennylp $ */
#ifndef __PJSIP_SIP_TYPES_H__
#define __PJSIP_SIP_TYPES_H__

#include <pjsip/sip_config.h>
#include <pj/types.h>

/**
 * Opaque data structure for transports (sip_transport.h).
 */
typedef struct pjsip_transport_t pjsip_transport_t;

/**
 * Opaque data type for transport manager (sip_transport.h).
 */
typedef struct pjsip_transport_mgr pjsip_transport_mgr;

/**
 * Transport types.
 */
typedef enum pjsip_transport_type_e
{
    /** Unspecified. */
    PJSIP_TRANSPORT_UNSPECIFIED,

    /** UDP. */
    PJSIP_TRANSPORT_UDP,

#if PJ_HAS_TCP
    /** TCP. */
    PJSIP_TRANSPORT_TCP,

    /** TLS. */
    PJSIP_TRANSPORT_TLS,

    /** SCTP. */
    PJSIP_TRANSPORT_SCTP,
#endif

} pjsip_transport_type_e;


/**
 * Forward declaration for endpoint (sip_endpoint.h).
 */
typedef struct pjsip_endpoint pjsip_endpoint;

/**
 * Forward declaration for transactions (sip_transaction.h).
 */
typedef struct pjsip_transaction pjsip_transaction;

/**
 * Forward declaration for events (sip_event.h).
 */
typedef struct pjsip_event pjsip_event;

/**
 * Forward declaration for transmit data/buffer (sip_transport.h).
 */
typedef struct pjsip_tx_data pjsip_tx_data;

/**
 * Forward declaration for receive data/buffer (sip_transport.h).
 */
typedef struct pjsip_rx_data pjsip_rx_data;

/**
 * Forward declaration for message (sip_msg.h).
 */
typedef struct pjsip_msg pjsip_msg;

/**
 * Forward declaration for URI (sip_uri.h).
 */
typedef struct pjsip_uri pjsip_uri;

/**
 * Opaque data type for the resolver engine (sip_resolve.h).
 */
typedef struct pjsip_resolver_t pjsip_resolver_t;

/**
 * Forward declaration for credential.
 */
typedef struct pjsip_cred_info pjsip_cred_info;


/**
 * Forward declaration for module (sip_module.h).
 */
typedef struct pjsip_module pjsip_module;

/**
 * Transaction role.
 */
typedef enum pjsip_role_e
{
    PJSIP_ROLE_UAC,	/**< Transaction role is UAC. */
    PJSIP_ROLE_UAS,	/**< Transaction role is UAS. */
} pjsip_role_e;


/**
 * General purpose buffer.
 */
typedef struct pjsip_buffer
{
    /** The start of the buffer. */
    char *start;

    /** Pointer to current end of the buffer, which also indicates the position
        of subsequent buffer write.
     */
    char *cur;

    /** The absolute end of the buffer. */
    char *end;

} pjsip_buffer;


/**
 * General host:port pair, used for example as Via sent-by.
 */
typedef struct pjsip_host_port
{
    unsigned flag;	/**< Flags of pjsip_transport_flags_e (not used in Via). */
    unsigned type;	/**< Transport type (pjsip_transport_type_e), or zero. */
    pj_str_t host;	/**< Host part. */
    int	     port;	/**< Port number. */
} pjsip_host_port;


#endif	/* __PJSIP_SIP_TYPES_H__ */