31#define STUN_IGNORE (0)
32#define STUN_ACCEPT (1)
34#define STUN_MAGIC_COOKIE 0x2112A442
195 const char *msg_class = NULL;
196 const char *method = NULL;
201 for (
unsigned int i = 0; classes[i].name; i++)
202 if (classes[i].
value == cvalue)
204 msg_class = classes[i].name;
208 for (
unsigned int i = 0; methods[i].name; i++)
209 if (methods[i].
value == mvalue)
211 method = methods[i].name;
217 method ? :
"Unknown Method",
218 msg_class ? :
"Unknown Class Message");
260 for (
unsigned int i = 0; attrs[i].name; i++)
262 return attrs[i].name;
263 return "Unknown Attribute";
struct GNUNET_MessageHeader * msg
static char * name
Name (label) of the records to list.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
#define GNUNET_UNUSED
gcc-ism to document unused arguments
#define GNUNET_PACKED
gcc-ism to get packed structs.
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
static enum StunClasses decode_class(int msg)
Convert a message to a StunClass.
static const char * stun_msg2str(int msg)
Print a class and method from a STUN message.
static const char * stun_attr2str(enum StunAttributes msg)
Print attribute name.
StunAttributes
Basic attribute types in stun messages.
@ STUN_UNKNOWN_ATTRIBUTES
@ STUN_MS_XOR_MAPPED_ADDRESS
@ STUN_XOR_MAPPED_ADDRESS
static enum StunMethods decode_method(int msg)
Convert a message to a StunMethod.
StunClasses
STUN message classes.
The format normally used for addresses carried by STUN messages.
uint8_t family
Address family, we expect AF_INET.
uint32_t addr
IPv4 address.
uint16_t port
Port number.