From e8a111fb866051275a6210449737ae325d6c7b36 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 17 Mar 2015 06:31:10 +0000 Subject: [PATCH] Inital commit FossilOrigin-Name: fc3203d9dc8faf6720dd674e3348649b90eff117cb7d17e895102f23a6aa120e --- src/capwap/lw_readelem_wtp_name.c | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/capwap/lw_readelem_wtp_name.c diff --git a/src/capwap/lw_readelem_wtp_name.c b/src/capwap/lw_readelem_wtp_name.c new file mode 100644 index 00000000..ecdec9e3 --- /dev/null +++ b/src/capwap/lw_readelem_wtp_name.c @@ -0,0 +1,53 @@ +/* + This file is part of libcapwap. + + libcapwap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + libcapwap is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . + +*/ + +/** + * @file + * @brief Implent lw_readelem_wtp_name + */ + + +#include "lwapp.h" + +#include "cw_util.h" +#include "cw_log.h" + +/** + * Reads the LWAPP message element WTP Name + * @param dts where to store the WTP name + * @param type msg element type, must be #LWMSGELEM_WTP_NAME + * @param msgelem the msg element + * @param len length of msg element + * return 0 No WTP name msg elem\n 1=Success + */ +int lw_readelem_wtp_name(uint8_t ** dst, int type, uint8_t * msgelem, int len) +{ + if (type != LWMSGELEM_WTP_NAME) + return 0; + + + if (len>254){ + cw_dbg(DBG_CW_MSG_ERR,"Truncating WTP_NAME msgelem to 254, wrong size, type=%d,len=%d",type,len); + len=254; + } + + cw_setstr(dst,msgelem,len); + return 1; +} + +