More move to cw_Conn and conn-stuff within on file

This commit is contained in:
2022-08-10 02:10:10 +02:00
parent f8654a0408
commit 9e54e46e45
14 changed files with 176 additions and 111 deletions

View File

@ -128,7 +128,7 @@ errX:
}
static int run_discovery(struct conn *conn, struct cw_DiscoveryResult * dis)
static int run_discovery(struct cw_Conn *conn, struct cw_DiscoveryResult * dis)
{
time_t timer;
struct sockaddr_storage from;
@ -200,7 +200,7 @@ static int run_discovery(struct conn *conn, struct cw_DiscoveryResult * dis)
/**
* Run discovery for on address (eg broadcast 255.255.255.255)
*/
int cw_run_discovery(struct conn *conn, const char *addr, const char *bindaddr,
int cw_run_discovery(struct cw_Conn *conn, const char *addr, const char *bindaddr,
struct cw_DiscoveryResult * dis)
{
char sock_buf[SOCK_ADDR_BUFSIZE];

View File

@ -32,7 +32,7 @@ void acinfo_log_(int level,const struct ac_info *acinfo,const char * xstr)
int join_state(struct conn * conn)
int join_state(struct cw_Conn * conn)
{
struct wtpinfo * wtpinfo = get_wtpinfo();
@ -98,7 +98,7 @@ acinfo.result_code=99;
int run_join_d(struct conn * conn, struct sockaddr *sa)
int run_join_d(struct cw_Conn * conn, struct sockaddr *sa)
{
char addrstr[SOCK_ADDR_BUFSIZE];
int sockfd;
@ -164,7 +164,7 @@ int run_join_d(struct conn * conn, struct sockaddr *sa)
int run_join(struct conn *conn)
int run_join(struct cw_Conn *conn)
{
char addrstr[SOCK_ADDR_BUFSIZE];
/*
@ -199,7 +199,7 @@ int run_join(struct conn *conn)
return 1;
}
int join(struct conn * conn, struct cw_DiscoveryResult * dis)
int join(struct cw_Conn * conn, struct cw_DiscoveryResult * dis)
{
mavliter_t ii;
mavliter_init(&ii,dis->prio_ip);

View File

@ -30,7 +30,7 @@
int update =1;
/*
int handle_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int handle_update_req(struct cw_Conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
if (a->msg_id == CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST){
@ -58,7 +58,7 @@ cw_dbg(DBG_X,"Saving configuration ...");
/*
static void update_radio(struct conn * conn, int rid, mbag_t radio_upd, mbag_t radio,mbag_t iresult )
static void update_radio(struct cw_Conn * conn, int rid, mbag_t radio_upd, mbag_t radio,mbag_t iresult )
{
printf("Updating radio with rid %d\n",rid);
@ -67,7 +67,7 @@ static void update_radio(struct conn * conn, int rid, mbag_t radio_upd, mbag_t r
/*
static void update_radios(struct conn * conn, mbag_t result)
static void update_radios(struct cw_Conn * conn, mbag_t result)
{
MAVLITER_DEFINE (it,conn->radios_upd);
mavliter_foreach(&it){
@ -87,7 +87,7 @@ static void update_radios(struct conn * conn, mbag_t result)
}
*/
static void do_update(struct conn * conn)
static void do_update(struct cw_Conn * conn)
{
int rc;
@ -138,7 +138,7 @@ void clean_cfg(mavl_t cfg)
}
int run(struct conn * conn)
int run(struct cw_Conn * conn)
{
@ -224,7 +224,7 @@ cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"KTV DUMP ----------------","Remote:",
/*
static int echo_interval_timer;
struct cwrmsg * get_response(struct conn * conn, int type,int seqnum)
struct cwrmsg * get_response(struct cw_Conn * conn, int type,int seqnum)
{
struct cwrmsg * cwrmsg;
int i;
@ -246,7 +246,7 @@ struct cwrmsg * get_response(struct conn * conn, int type,int seqnum)
/*
struct cwrmsg * send_request(struct conn * conn,struct cwmsg *cwmsg)
struct cwrmsg * send_request(struct cw_Conn * conn,struct cwmsg *cwmsg)
{
int i;
for (i=0; i<conf_max_retransmit; i++){
@ -272,10 +272,10 @@ struct cwrmsg * send_request(struct conn * conn,struct cwmsg *cwmsg)
*/
/*//extern struct conn * get_conn();*/
/*//extern struct cw_Conn * get_conn();*/
/*
int run(struct conn * conn)
int run(struct cw_Conn * conn)
{
conn = get_conn();

View File

@ -9,7 +9,7 @@ extern int sulking_state();
extern int join();
extern int discovery();
extern int image_update();
extern int setup_conf(struct conn * conn);
extern int setup_conf(struct cw_Conn * conn);
extern int configure();
extern int run();
extern int changestate();
@ -22,13 +22,13 @@ struct cw_DiscoveryResult{
mlist_t results;
};
int cw_run_discovery(struct conn *conn, const char *acaddr, const char *bindaddr,
int cw_run_discovery(struct cw_Conn *conn, const char *acaddr, const char *bindaddr,
struct cw_DiscoveryResult * dis);
int cw_discovery_init_results(struct cw_DiscoveryResult *dis);
void cw_discovery_free_results(struct cw_DiscoveryResult * dis);
int join(struct conn * conn, struct cw_DiscoveryResult * dis);
int join(struct cw_Conn * conn, struct cw_DiscoveryResult * dis);
struct conn * get_conn();
struct cw_Conn * get_conn();
#endif

View File

@ -4,7 +4,7 @@
#include <stdint.h>
#include "cw/bstr.h"
extern struct conn * get_conn();
extern struct cw_Conn * get_conn();
extern bstr_t get_base_rmac();
uint8_t get_ecn_support();

View File

@ -86,7 +86,7 @@ int main (int argc, char **argv)
struct bootcfg bootcfg;
struct cw_Mod * mod;
struct cw_MsgSet * msgset;
struct conn * conn;
struct cw_Conn * conn;
FILE * file;
mavl_t global_cfg, types_tree;
const cw_Type_t ** ti;