James Kuszmaul | 82f6c04 | 2021-01-17 11:30:16 -0800 | [diff] [blame^] | 1 | /** |
| 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 */ |
| 14 | const char *stun_reason_300 = "Try Alternate"; |
| 15 | const char *stun_reason_400 = "Bad Request"; |
| 16 | const char *stun_reason_401 = "Unauthorized"; |
| 17 | const char *stun_reason_403 = "Forbidden"; |
| 18 | const char *stun_reason_420 = "Unknown Attribute"; |
| 19 | const char *stun_reason_437 = "Allocation Mismatch"; |
| 20 | const char *stun_reason_438 = "Stale Nonce"; |
| 21 | const char *stun_reason_440 = "Address Family not Supported"; |
| 22 | const char *stun_reason_441 = "Wrong Credentials"; |
| 23 | const char *stun_reason_442 = "Unsupported Transport Protocol"; |
| 24 | const char *stun_reason_443 = "Peer Address Family Mismatch"; |
| 25 | const char *stun_reason_486 = "Allocation Quota Reached"; |
| 26 | const char *stun_reason_500 = "Server Error"; |
| 27 | const 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 | */ |
| 37 | const 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 | } |