7 #define STUN_MSGTYPE_BINDING_REQUEST 0x0001
8 #define STUN_MSGTYPE_BINDING_RESPONSE 0x0101
9 #define STUN_MSGTYPE_BINDING_ERROR 0x0111
10 #define STUN_MSGTYPE_BINDING_INDICATION 0x0011
12 #define STUN_MSGTYPE_SHARED_SECRET_REQUEST 0x0002
13 #define STUN_MSGTYPE_SHARED_SECRET_RESPONSE 0x0102
14 #define STUN_MSGTYPE_SHARED_SECRET_ERROR 0x0112
16 #define STUN_MAGIC 0x2112a442
19 STUN_TLV_MAPPED_ADDRESS
= 0x01,
20 STUN_TLV_RESPONSE_ADDRESS
= 0x02,
21 STUN_TLV_CHANGE_REQUEST
= 0x03,
22 STUN_TLV_SOURCE_ADDRESS
= 0x04,
23 STUN_TLV_CHANGED_ADDRESS
= 0x05,
24 STUN_TLV_XOR_MAPPED_ADDRESS
= 0x20,
25 STUN_TLV_RESPONSE_PORT
= 0x27,
32 uint8_t transaction
[12];
40 struct stun_tlv_policy
{
46 uint8_t transaction
[12];
51 bool stun_msg_is_valid(const void *data
, size_t len
);
52 const void *stun_msg_request_prepare(struct stun_request
*req
, size_t *len
,
53 uint16_t response_port
);
54 bool stun_msg_request_complete(struct stun_request
*req
, const void *data
,