From d3119dfef5d4576acede79719177360b5dfa0927 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Mon, 4 May 2015 05:27:35 +0000 Subject: [PATCH] New files. FossilOrigin-Name: 2a7c230f1c4b05ec3ecd04e5b231f9fe290877c96c15ba08f65cd0f0e6b659ca --- src/capwap/cw_format_version.c | 85 ---------------------------------- src/capwap/doc.dox | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 85 deletions(-) delete mode 100644 src/capwap/cw_format_version.c create mode 100644 src/capwap/doc.dox diff --git a/src/capwap/cw_format_version.c b/src/capwap/cw_format_version.c deleted file mode 100644 index 63f991be..00000000 --- a/src/capwap/cw_format_version.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - 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 . - -*/ - -#include - -#include "lwapp.h" -#include "cw_util.h" - -/** - *@file - *@brief Implementation of cw_sprintf_version - */ - - -/** - * Converts a CAPWAP version string to readable format. - * @param s target where the formated string will be stored - * @param ver the CAPWAP version data - * @param vendor vendor id - * @param def default string will be printed if version is NULL - * @return the number bytes added to the output *s - * - * This function tries to determine if the bstr_t string version - * is human readable, and if not, it will put out a hexadecimal value - * or a dot-seaprated list of number for version elements used - * by Cisco. - */ -int cw_format_version(char *s, bstr_t ver, uint32_t vendor, char * def) -{ - if (!ver) - return sprintf(s,"%s",def); - - - uint8_t * version = bstr_data(ver); - int len = bstr_len(ver); - - - - int rs=0; - int i; - - - if ( cw_is_printable(version,len) ){ - if (len != 0 ) - rs+=sprintf(s+rs,"%s",version); - else - rs+=sprintf(s+rs,"''"); - } - else{ - for (i=0; i