actube/src/ac/wtpman.h

73 lines
1.2 KiB
C
Raw Normal View History

#ifndef __WTPMAN_H
#define __WTPMAN_H
#include <sys/socket.h>
#include <semaphore.h>
#include <pthread.h>
#include "cw/capwap.h"
#include "cw/fragman.h"
#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"
#define WTPMAN_QSIZE 1024
2022-08-09 09:52:30 +02:00
struct wtpman {
pthread_t thread;
2022-08-09 22:35:47 +02:00
struct cw_Conn *conn;
/* wtp data */
2022-08-09 09:52:30 +02:00
uint8_t *wtp_name;
uint8_t *wtp_location;
uint8_t *session_id;
uint8_t wtp_mactype;
int socklistindex;
int connected;
int dtlsmode;
2022-08-09 09:52:30 +02:00
cw_timer_t echointerval_timer;
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-13 09:47:12 +02:00
cw_MsgCallbackFun pdiscovery;
cw_MsgCallbackFun pjoin;
cw_MsgCallbackFun pupdate;
};
/*
struct wtp{
};
//extern void wtpman_run(void *arg);
*/
2022-08-09 09:52:30 +02:00
struct wtpman *wtpman_create();
2022-08-09 09:52:30 +02:00
struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
int dtlsmode, cw_Cfg_t * global_cfg);
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);
#endif