<commit_before>#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include <arpa/inet.h>

#include "wtplist.h"

#include "capwap.h"
#include "socklist.h"

#include "conn.h"
#include "wtpman.h"
#include "conf.h"
#include "cw_log.h"

#include "dtls.h"



#include "conf.h"




#include <errno.h>

#include "capwap.h"



ACIPLIST * get_aciplist();
struct ac_info * get_acinfo();


static void process_discovery(struct wtpman * wtpman, struct cwrmsg * cwrmsg)
//uint8_t * hdr, uint8_t *msg, int len)
{
	printf("process_discovery called\n");
	printf("cwmsg: %p\n",cwrmsg);
	printf("Message Type: %p\n",&cwrmsg->type);
	printf("Message Type: %d\n",cwrmsg->type);
	printf("WBID %d\n",cwrmsg->wbid);

	switch (cwrmsg->type){
		case CWMSG_DISCOVERY_REQUEST:
			printf ("got a discovery requesti DISC\n");
			printf("MSGELEMS: %p\n",cwrmsg->msgelems);
			printf("Seqnum %d\n",cwrmsg->seqnum);
			printf("RIIIID: %d\n",cwrmsg->rid);
			struct radioinfo radioinfo;
			radioinfo.rid = cwrmsg->rid;
			radioinfo.rmac = cwrmsg->rmac;
			struct ac_info acinfo;
//			capwap_init_acinfo(&acinfo);
			process_discovery_request(&wtpman->wtpinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);

			wtpinfo_print(&wtpman->wtpinfo);

		//	struct radioinfo radioinfo;
			cwsend_discovery_response(wtpman->conn,cwrmsg->seqnum,&radioinfo,&acinfo,&wtpman->wtpinfo);			
			break;
		case CWMSG_JOIN_REQUEST:
			printf ("Join message!!!!!!!!!!!!!!!!\n");
			process_join_request(&wtpman->wtpinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
			wtpinfo_print(&wtpman->wtpinfo);

			exit(1);
			break;
		default:
			printf ("Unknown message\n");
			exit(1);
			break;

	}


}

static void wtpman_remove(struct wtpman * wtpman)
{
	wtplist_lock();
	wtplist_remove(wtpman);
	wtplist_unlock();
	wtpman_destroy(wtpman);
}

static void wtpman_run_discovery(void *arg)
{
	struct wtpman * wtpman = (struct wtpman *)arg;
	
	struct cwrmsg * cwrmsg;
//	do {
		cwrmsg = conn_get_message(wtpman->conn);
//	}while (!cwrmsg);


	if ( !cwrmsg)
	{
		wtpman_remove(wtpman);
		return;
	}

	if (cwrmsg->type==CWMSG_DISCOVERY_REQUEST){	<commit_msg>Removed dead code<commit_after>#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include <arpa/inet.h>

#include "wtplist.h"

#include "capwap.h"
#include "socklist.h"

#include "conn.h"
#include "wtpman.h"
#include "conf.h"
#include "cw_log.h"

#include "dtls.h"



#include "conf.h"




#include <errno.h>

#include "capwap.h"



ACIPLIST * get_aciplist();
struct ac_info * get_acinfo();

static void wtpman_remove(struct wtpman * wtpman)
{
	wtplist_lock();
	wtplist_remove(wtpman);
	wtplist_unlock();
	wtpman_destroy(wtpman);
}

static void wtpman_run_discovery(void *arg)
{
	struct wtpman * wtpman = (struct wtpman *)arg;
	
	struct cwrmsg * cwrmsg;
//	do {
		cwrmsg = conn_get_message(wtpman->conn);
//	}while (!cwrmsg);


	if ( !cwrmsg)
	{
		wtpman_remove(wtpman);
		return;
	}

	if (cwrmsg->type==CWMSG_DISCOVERY_REQUEST){	
{'fraction_non_alphanumeric': 0.16593739481656009, 'fraction_numerical': 0.0013463480309660047, 'mean_word_length': 4.8046875, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '570337', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1254, 'n_words': 217}