cw_ElemHandler->type is now void *
FossilOrigin-Name: 003406770903c77846a8dbb39a466e6fc226f930ac036857518b2c1321b54f29
This commit is contained in:
		| @ -4,8 +4,8 @@ | |||||||
|   <Project Name="wtp" Path="wtp.project" Active="No"/> |   <Project Name="wtp" Path="wtp.project" Active="No"/> | ||||||
|   <Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/> |   <Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/> | ||||||
|   <Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/> |   <Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/> | ||||||
|   <Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/> |   <Project Name="mod_cisco" Path="mod_cisco.project" Active="Yes"/> | ||||||
|   <Project Name="libcw" Path="libcw.project" Active="Yes"/> |   <Project Name="libcw" Path="libcw.project" Active="No"/> | ||||||
|   <Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/> |   <Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/> | ||||||
|   <Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/> |   <Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/> | ||||||
|   <BuildMatrix> |   <BuildMatrix> | ||||||
|  | |||||||
| @ -44,10 +44,10 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams | |||||||
| 		} | 		} | ||||||
| 		return 0; | 		return 0; | ||||||
| 	}  | 	}  | ||||||
| 	len = handler->type->put(elem,dst+start); | 	len = ((const cw_Type_t*)(handler->type))->put(elem,dst+start); | ||||||
| 	 | 	 | ||||||
| 	 | 	 | ||||||
| 	handler->type->to_str(elem,detail,120); | 	((const cw_Type_t*)(handler->type))->to_str(elem,detail,120); | ||||||
| 	sprintf(params->debug_details, "  Value = %s", detail); | 	sprintf(params->debug_details, "  Value = %s", detail); | ||||||
| 	 | 	 | ||||||
| 	params->elem = elem; | 	params->elem = elem; | ||||||
|  | |||||||
| @ -172,13 +172,13 @@ static int update_msgdata(struct cw_MsgSet *set, struct cw_MsgData *msgdata, | |||||||
| 			continue; | 			continue; | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 		if (handler->type != NULL){ | /*		if (handler->type != NULL){ | ||||||
| 			if (mavl_add_ptr( set->types_tree, handler->type ) == NULL){ | 			if (mavl_add_ptr( set->types_tree, handler->type ) == NULL){ | ||||||
| 				cw_log(LOG_ERR, "Can't add type from handler: %s", strerror(errno)); | 				cw_log(LOG_ERR, "Can't add type from handler: %s", strerror(errno)); | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		 | */		 | ||||||
|  |  | ||||||
| 		ed.id = elemdef->id; | 		ed.id = elemdef->id; | ||||||
| 		ed.proto = elemdef->proto; | 		ed.proto = elemdef->proto; | ||||||
|  | |||||||
| @ -40,10 +40,7 @@ struct cw_ElemHandlerParams { | |||||||
| 	char * debug_details; | 	char * debug_details; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| union handlerType{ |  | ||||||
| 	const struct cw_Type type; |  | ||||||
| 	int x; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| struct cw_ElemHandler { | struct cw_ElemHandler { | ||||||
| 	const char * name; | 	const char * name; | ||||||
| @ -52,8 +49,8 @@ struct cw_ElemHandler { | |||||||
| 	int proto; | 	int proto; | ||||||
| 	int min_len; | 	int min_len; | ||||||
| 	int max_len; | 	int max_len; | ||||||
| 	const struct cw_Type * type; | 	/*const struct cw_Type * type;*/ | ||||||
| /*	union handlerType type; */ | 	const void * type; | ||||||
| 	const char * key; | 	const char * key; | ||||||
|         int (*get)(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,  |         int (*get)(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,  | ||||||
| 		uint8_t*data, int len); | 		uint8_t*data, int len); | ||||||
|  | |||||||
| @ -35,8 +35,17 @@ | |||||||
|  |  | ||||||
| /* #include "include/capwap_actions.h" */ | /* #include "include/capwap_actions.h" */ | ||||||
|  |  | ||||||
|  | /* | ||||||
|  | 	const struct cw_Type * type; | ||||||
|  | 	const char * key; | ||||||
|  | 	int len; | ||||||
|  | 	int position; | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | static cw_KTVStruct_t ap_time_sync[] = { | ||||||
|  | 	{CW_TYPE_DWORD, "timestamp", 4,-1}, | ||||||
|  | 	{CW_TYPE_BYTE, "type", 1,-1} | ||||||
|  | }; | ||||||
|  |  | ||||||
| static struct cw_ElemHandler handlers[] = { | static struct cw_ElemHandler handlers[] = { | ||||||
| 	{  | 	{  | ||||||
| @ -87,11 +96,11 @@ static struct cw_ElemHandler handlers[] = { | |||||||
| 		"AP Time Sync",			/* name */ | 		"AP Time Sync",			/* name */ | ||||||
| 		CISCO_ELEM_AP_TIMESYNC,		/* Element ID */ | 		CISCO_ELEM_AP_TIMESYNC,		/* Element ID */ | ||||||
| 		CW_VENDOR_ID_CISCO,0,		/* Vendor / Proto */ | 		CW_VENDOR_ID_CISCO,0,		/* Vendor / Proto */ | ||||||
| 		4,4,				/* min/max length */ | 		5,5,				/* min/max length */ | ||||||
| 		CW_TYPE_DWORD,			/* type */ | 		ap_time_sync,			/* type */ | ||||||
| 		"cisco/ap-timesync",		/* Key */ | 		"cisco/ap-timesync",		/* Key */ | ||||||
| 		cw_in_generic,			/* handler */ | 		NULL,				/* handler */ | ||||||
| 		cw_out_generic			/* put */ | 		NULL				/* put */ | ||||||
| 	} | 	} | ||||||
| 	, | 	, | ||||||
| 	 | 	 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user