blob: 2d0de0926285b47f91cc57bc124975499eed4550 [file] [log] [blame]
James Kuszmaul82f6c042021-01-17 11:30:16 -08001/**
2 * @file stunstr.c STUN Strings
3 *
4 * Copyright (C) 2010 Creytiv.com
5 */
6#include <re_types.h>
7#include <re_mbuf.h>
8#include <re_list.h>
9#include <re_sa.h>
10#include <re_stun.h>
11
12
13/* STUN Reason Phrase */
14const char *stun_reason_300 = "Try Alternate";
15const char *stun_reason_400 = "Bad Request";
16const char *stun_reason_401 = "Unauthorized";
17const char *stun_reason_403 = "Forbidden";
18const char *stun_reason_420 = "Unknown Attribute";
19const char *stun_reason_437 = "Allocation Mismatch";
20const char *stun_reason_438 = "Stale Nonce";
21const char *stun_reason_440 = "Address Family not Supported";
22const char *stun_reason_441 = "Wrong Credentials";
23const char *stun_reason_442 = "Unsupported Transport Protocol";
24const char *stun_reason_443 = "Peer Address Family Mismatch";
25const char *stun_reason_486 = "Allocation Quota Reached";
26const char *stun_reason_500 = "Server Error";
27const char *stun_reason_508 = "Insufficient Capacity";
28
29
30/**
31 * Get the name of a given STUN Transport
32 *
33 * @param tp STUN Transport
34 *
35 * @return Name of the corresponding STUN Transport
36 */
37const char *stun_transp_name(enum stun_transp tp)
38{
39 switch (tp) {
40
41 case STUN_TRANSP_UDP: return "UDP";
42 case STUN_TRANSP_TCP: return "TCP";
43 case STUN_TRANSP_DTLS: return "DTLS";
44 default: return "???";
45 }
46}