Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | /********************************************************************************************************* |
| 2 | * Software License Agreement (BSD License) * |
| 3 | * Author: Sebastien Decugis <sdecugis@freediameter.net> * |
| 4 | * * |
| 5 | * Copyright (c) 2011, WIDE Project and NICT * |
| 6 | * All rights reserved. * |
| 7 | * * |
| 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * |
| 9 | * permitted provided that the following conditions are met: * |
| 10 | * * |
| 11 | * * Redistributions of source code must retain the above * |
| 12 | * copyright notice, this list of conditions and the * |
| 13 | * following disclaimer. * |
| 14 | * * |
| 15 | * * Redistributions in binary form must reproduce the above * |
| 16 | * copyright notice, this list of conditions and the * |
| 17 | * following disclaimer in the documentation and/or other * |
| 18 | * materials provided with the distribution. * |
| 19 | * * |
| 20 | * * Neither the name of the WIDE Project or NICT nor the * |
| 21 | * names of its contributors may be used to endorse or * |
| 22 | * promote products derived from this software without * |
| 23 | * specific prior written permission of WIDE Project and * |
| 24 | * NICT. * |
| 25 | * * |
| 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * |
| 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * |
| 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * |
| 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
| 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * |
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * |
| 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * |
| 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
| 34 | *********************************************************************************************************/ |
| 35 | #include "rgw_common.h" |
| 36 | |
| 37 | /* The content of this file was semi-automatically generated from the IANA registry. */ |
| 38 | |
| 39 | /* Name of RADIUS command from its command code */ |
| 40 | const char * rgw_msg_code_str(unsigned char c) { |
| 41 | /* 1 Access-Request [RFC2865] */ |
| 42 | if ( c == 1) return "Access-Request [RFC2865]"; |
| 43 | /* 2 Access-Accept [RFC2865] */ |
| 44 | if ( c == 2) return "Access-Accept [RFC2865]"; |
| 45 | /* 3 Access-Reject [RFC2865] */ |
| 46 | if ( c == 3) return "Access-Reject [RFC2865]"; |
| 47 | /* 4 Accounting-Request [RFC2865] */ |
| 48 | if ( c == 4) return "Accounting-Request [RFC2865]"; |
| 49 | /* 5 Accounting-Response [RFC2865] */ |
| 50 | if ( c == 5) return "Accounting-Response [RFC2865]"; |
| 51 | /* 6 Accounting-Status [RFC3575] */ |
| 52 | if ( c == 6) return "Accounting-Status [RFC3575]"; |
| 53 | /* 7 Password-Request [RFC3575] */ |
| 54 | if ( c == 7) return "Password-Request [RFC3575]"; |
| 55 | /* 8 Password-Ack [RFC3575] */ |
| 56 | if ( c == 8) return "Password-Ack [RFC3575]"; |
| 57 | /* 9 Password-Reject [RFC3575] */ |
| 58 | if ( c == 9) return "Password-Reject [RFC3575]"; |
| 59 | /* 10 Accounting-Message [RFC3575] */ |
| 60 | if ( c == 10) return "Accounting-Message [RFC3575]"; |
| 61 | /* 11 Access-Challenge [RFC2865] */ |
| 62 | if ( c == 11) return "Access-Challenge [RFC2865]"; |
| 63 | /* 12 Status-Server (experimental) [RFC2865] */ |
| 64 | if ( c == 12) return "Status-Server (experimental)[RFC2865]"; |
| 65 | /* 13 Status-Client (experimental) [RFC2865] */ |
| 66 | if ( c == 13) return "Status-Client (experimental)[RFC2865]"; |
| 67 | /* 21 Resource-Free-Request [RFC3575] */ |
| 68 | if ( c == 21) return "Resource-Free-Request [RFC3575]"; |
| 69 | /* 22 Resource-Free-Response [RFC3575] */ |
| 70 | if ( c == 22) return "Resource-Free-Response [RFC3575]"; |
| 71 | /* 23 Resource-Query-Request [RFC3575] */ |
| 72 | if ( c == 23) return "Resource-Query-Request [RFC3575]"; |
| 73 | /* 24 Resource-Query-Response [RFC3575] */ |
| 74 | if ( c == 24) return "Resource-Query-Response [RFC3575]"; |
| 75 | /* 25 Alternate-Resource-Reclaim-Request [RFC3575] */ |
| 76 | if ( c == 25) return "Alternate-Resource-Reclaim-Request [RFC3575]"; |
| 77 | /* 26 NAS-Reboot-Request [RFC3575] */ |
| 78 | if ( c == 26) return "NAS-Reboot-Request [RFC3575]"; |
| 79 | /* 27 NAS-Reboot-Response [RFC3575] */ |
| 80 | if ( c == 27) return "NAS-Reboot-Response [RFC3575]"; |
| 81 | /* 28 Reserved */ |
| 82 | if ( c == 28) return "Reserved "; |
| 83 | /* 29 Next-Passcode [RFC3575] */ |
| 84 | if ( c == 29) return "Next-Passcode [RFC3575]"; |
| 85 | /* 30 New-Pin [RFC3575] */ |
| 86 | if ( c == 30) return "New-Pin [RFC3575]"; |
| 87 | /* 31 Terminate-Session [RFC3575] */ |
| 88 | if ( c == 31) return "Terminate-Session [RFC3575]"; |
| 89 | /* 32 Password-Expired [RFC3575] */ |
| 90 | if ( c == 32) return "Password-Expired [RFC3575]"; |
| 91 | /* 33 Event-Request [RFC3575] */ |
| 92 | if ( c == 33) return "Event-Request [RFC3575]"; |
| 93 | /* 34 Event-Response [RFC3575] */ |
| 94 | if ( c == 34) return "Event-Response [RFC3575]"; |
| 95 | /* 40 Disconnect-Request [RFC3575][RFC5176] */ |
| 96 | if ( c == 40) return "Disconnect-Request [RFC3575][RFC5176]"; |
| 97 | /* 41 Disconnect-ACK [RFC3575][RFC5176] */ |
| 98 | if ( c == 41) return "Disconnect-ACK [RFC3575][RFC5176]"; |
| 99 | /* 42 Disconnect-NAK [RFC3575][RFC5176] */ |
| 100 | if ( c == 42) return "Disconnect-NAK [RFC3575][RFC5176]"; |
| 101 | /* 43 CoA-Request [RFC3575][RFC5176] */ |
| 102 | if ( c == 43) return "CoA-Request [RFC3575][RFC5176]"; |
| 103 | /* 44 CoA-ACK [RFC3575][RFC5176] */ |
| 104 | if ( c == 44) return "CoA-ACK [RFC3575][RFC5176]"; |
| 105 | /* 45 CoA-NAK [RFC3575][RFC5176] */ |
| 106 | if ( c == 45) return "CoA-NAK [RFC3575][RFC5176]"; |
| 107 | /* 50 IP-Address-Allocate [RFC3575] */ |
| 108 | if ( c == 50) return "IP-Address-Allocate [RFC3575]"; |
| 109 | /* 51 IP-Address-Release [RFC3575] */ |
| 110 | if ( c == 51) return "IP-Address-Release [RFC3575]"; |
| 111 | /* 52-249 Unassigned */ |
| 112 | if ((c >= 52) && (c <= 249)) return "Unassigned "; |
| 113 | /* 250-253 Experimental Use [RFC3575] */ |
| 114 | if ((c >= 250) && (c <= 253)) return "Experimental Use[RFC3575]"; |
| 115 | /* 254 Reserved [RFC3575] */ |
| 116 | if ( c == 254) return "Reserved [RFC3575]"; |
| 117 | /* 255 Reserved [RFC3575] */ |
| 118 | if ( c == 255) return "Reserved [RFC3575]"; |
| 119 | /* fallback */ return "[Unknown]"; |
| 120 | } |