2014-07-11 22:12:11 +02:00
|
|
|
#ifndef __WTPMAN_H
|
|
|
|
#define __WTPMAN_H
|
|
|
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <semaphore.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
2016-03-03 20:46:20 +01:00
|
|
|
#include "cw/capwap.h"
|
|
|
|
#include "cw/fragman.h"
|
2016-03-27 04:43:48 +02:00
|
|
|
#include "cw/timer.h"
|
2022-08-09 09:52:30 +02:00
|
|
|
#include "cw/cfg.h"
|
2022-08-13 09:47:12 +02:00
|
|
|
#include "cw/capwap.h"
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#define WTPMAN_QSIZE 1024
|
|
|
|
|
2022-08-09 09:52:30 +02:00
|
|
|
struct wtpman {
|
2014-07-11 22:12:11 +02:00
|
|
|
pthread_t thread;
|
|
|
|
|
2022-08-09 22:35:47 +02:00
|
|
|
struct cw_Conn *conn;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* wtp data */
|
2022-08-09 09:52:30 +02:00
|
|
|
uint8_t *wtp_name;
|
|
|
|
uint8_t *wtp_location;
|
|
|
|
uint8_t *session_id;
|
2014-07-11 22:12:11 +02:00
|
|
|
uint8_t wtp_mactype;
|
|
|
|
|
|
|
|
int socklistindex;
|
2016-03-27 04:43:48 +02:00
|
|
|
int connected;
|
|
|
|
|
2018-04-02 01:39:08 +02:00
|
|
|
int dtlsmode;
|
2016-03-27 04:43:48 +02:00
|
|
|
|
2022-08-09 09:52:30 +02:00
|
|
|
cw_timer_t echointerval_timer;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2022-08-11 00:21:01 +02:00
|
|
|
cw_Cfg_t * global_cfg; /**< contains the cfg of AC,
|
|
|
|
visible to all wtpman threads.
|
|
|
|
The global cfg was initally read
|
|
|
|
from a .ckv file on startup.
|
|
|
|
*/
|
|
|
|
|
2022-08-14 12:26:34 +02:00
|
|
|
cw_Cfg_t * wtp_cfg;
|
2014-07-19 12:16:40 +02:00
|
|
|
|
2022-08-28 09:06:15 +02:00
|
|
|
int update;
|
2022-08-27 00:24:20 +02:00
|
|
|
int ctr;
|
2014-07-11 22:12:11 +02:00
|
|
|
};
|
|
|
|
|
2018-03-20 18:47:06 +01:00
|
|
|
/*
|
2014-07-11 22:12:11 +02:00
|
|
|
struct wtp{
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//extern void wtpman_run(void *arg);
|
2018-03-20 18:47:06 +01:00
|
|
|
*/
|
|
|
|
|
2022-08-09 09:52:30 +02:00
|
|
|
struct wtpman *wtpman_create();
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2022-08-09 09:52:30 +02:00
|
|
|
struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
|
|
|
|
int dtlsmode, cw_Cfg_t * global_cfg);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2022-08-09 09:52:30 +02:00
|
|
|
extern void wtpman_addpacket(struct wtpman *wtpman, uint8_t * packet, int len);
|
|
|
|
extern void wtpman_destroy(struct wtpman *wtpman);
|
|
|
|
extern void wtpman_start(struct wtpman *wtpman, int dtlsmode);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|