2014-07-11 22:12:11 +02:00
|
|
|
/*
|
|
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-03-15 20:53:21 +01:00
|
|
|
/**
|
|
|
|
*@file
|
|
|
|
*@brief Definitions for imisc. cw_utill functions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CW_UTIL_H
|
|
|
|
#define __CW_UTIL_H
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
#include <stdint.h>
|
2014-08-16 09:07:56 +02:00
|
|
|
#include <time.h>
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-03-15 20:53:21 +01:00
|
|
|
#include "bstr.h"
|
|
|
|
|
|
|
|
extern int cw_format_version(char *s, bstr_t version, uint32_t vendor, char * def);
|
|
|
|
extern int cw_is_printable(const uint8_t * s,int len);
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2015-03-15 20:53:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern uint8_t * cw_setstr(uint8_t ** dst, const uint8_t *src, int len);
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
extern int cw_foreach_msgelem(uint8_t * msgelems, int len,
|
|
|
|
int (*callback)(void*,int,uint8_t*,int),void *arg );
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-16 09:07:56 +02:00
|
|
|
|
|
|
|
|
2015-04-10 17:14:55 +02:00
|
|
|
//#define cw_timer_start(t) (time(NULL)+t)
|
|
|
|
//#define cw_timer_timeout(t) (time(NULL)>t ? 1 : 0)
|
2014-08-17 18:38:29 +02:00
|
|
|
|
|
|
|
|
2015-03-23 07:48:27 +01:00
|
|
|
/** Generic macro to isolate bits from a dword */
|
2014-08-17 18:38:29 +02:00
|
|
|
#define cw_get_dword_bits(src,start,len) ((~(0xFFFFFFFF<<len)) & (src >> (32 - start - len)))
|
|
|
|
|
|
|
|
|
2014-08-18 01:44:16 +02:00
|
|
|
/* functions used to "rfc-verify" message elements */
|
2015-04-10 21:44:05 +02:00
|
|
|
//void cw_mand_elem_found(int *l,int type);
|
2015-04-07 07:42:36 +02:00
|
|
|
//int cw_is_missing_mand_elems(int *l);
|
2015-04-10 21:44:05 +02:00
|
|
|
//void cw_get_missing_mand_elems(char *dst, int *l);
|
2014-08-18 01:44:16 +02:00
|
|
|
|
2015-03-16 21:41:33 +01:00
|
|
|
|
|
|
|
|
2015-04-10 17:14:55 +02:00
|
|
|
//extern const char * cw_msgtostr(int type);
|
2015-03-16 21:41:33 +01:00
|
|
|
|
2015-03-15 20:53:21 +01:00
|
|
|
#endif
|