Compare commits
	
		
			11 Commits
		
	
	
		
			86956ff1ce
			...
			typeless
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 34f5589a17 | |||
| e3ccf2a93c | |||
| 276a282369 | |||
| d127263d80 | |||
| c3b921292b | |||
| 744e1b55c2 | |||
| 2098cabad1 | |||
| 49905b2aa0 | |||
| e571a27c75 | |||
| a59a25baa5 | |||
| 57890907ae | 
							
								
								
									
										15
									
								
								src/ac/act.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/ac/act.c
									
									
									
									
									
								
							| @ -97,10 +97,8 @@ prompt(EditLine *el ) | ||||
| 		rc=get_result(act_f,str2,64); | ||||
| 	} | ||||
|  | ||||
| 	static char a[] = "\1\033[7m\1Edit$\1\033[0m\1 "; | ||||
| 	static char b[] = "> "; | ||||
|  | ||||
| 	return (continuation ? b : str); | ||||
| 	return (continuation ? "> " : str); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @ -367,9 +365,16 @@ main(int argc , char *argv[]) | ||||
| 			} | ||||
| 		} else if (el_parse(el, ac, av) == -1) { | ||||
| 			char str[2000]; | ||||
|  | ||||
| 			int i; | ||||
| 			char * sp =""; | ||||
| 			str[0]=0; | ||||
| 			fprintf(act_f,"%s\n",av[0]); | ||||
|  | ||||
| 			for (i=0; i<ac; i++){ | ||||
| 				fprintf(act_f,"%s%s",sp,av[i]); | ||||
| 				sp=" "; | ||||
| 			} | ||||
| 			fprintf(act_f,"\n"); | ||||
|  | ||||
| 			fflush(act_f); | ||||
| 			do { | ||||
| 				int n; | ||||
|  | ||||
| @ -289,13 +289,13 @@ int init_bcast_addrs(cw_Cfg_t *cfg) | ||||
|  | ||||
|  | ||||
| 		if (ifa->ifa_broadaddr) { | ||||
| 			char *s,*sr; | ||||
| 			char *s; //,*sr; | ||||
| 			sock_addrtostr(ifa->ifa_broadaddr, str, 100,1); | ||||
| 			*strchr(str, ':') = 0; | ||||
|  | ||||
|  | ||||
| 			s = cw_strdup(str); | ||||
| 			sr = mavl_add_str(t, s); | ||||
| 			mavl_add_str(t, s); | ||||
|  | ||||
|  | ||||
| //			printf("BCAST = %p --- %p: %s\n",str,s,str); | ||||
|  | ||||
| @ -6,7 +6,7 @@ | ||||
| # | ||||
| #capwap/ac-name | ||||
| # | ||||
| capwap/ac-name: actube | ||||
| capwap/ac-name: actube_X | ||||
|  | ||||
| capwap/ssl-cipher: DHE-RSA:RSA:AES-256-CBC:AES-128-CBC:SHA1:PSK | ||||
| capwap/ssl-psk-enable: false | ||||
| @ -36,7 +36,7 @@ actube/ipv6: false | ||||
| #actube/mod.2: capwap80211 | ||||
| # | ||||
|  | ||||
| #actube/mod.0: cisco | ||||
| actube/mod.0: cisco | ||||
| actube/mod.1: capwap | ||||
| actube/mod.2: capwap80211 | ||||
|  | ||||
| @ -45,31 +45,31 @@ actube/rpc/listen: tcp:127.0.0.1:5000 | ||||
| actube/rpc/enable: true | ||||
|  | ||||
|  | ||||
| ac-descriptor/dtls-policy:  1 | ||||
| ac-descriptor/hardware/vendor: 4232704 | ||||
| ac-descriptor/hardware/version: .x01000001 | ||||
| ac-descriptor/max-wtps : 200 | ||||
| ac-descriptor/active-wtps:  2 | ||||
| ac-descriptor/r-mac-field: 1 | ||||
| ac-descriptor/reserved1 : 0 | ||||
| ac-descriptor/security : 2 | ||||
| ac-descriptor/software/vendor : 0 | ||||
| ac-descriptor/software/version: v0.0.1 | ||||
| ac-descriptor/station-limit: 1000 | ||||
| ac-descriptor/stations: 0 | ||||
| capwap/ac-descriptor/dtls-policy:  1 | ||||
| capwap/ac-descriptor/hardware/vendor: 4232704 | ||||
| capwap/ac-descriptor/hardware/version: .x01000001 | ||||
| capwap/ac-descriptor/max-wtps : 200 | ||||
| capwap/ac-descriptor/active-wtps:  2 | ||||
| capwap/ac-descriptor/r-mac-field: 1 | ||||
| cawpap/ac-descriptor/reserved1 : 0 | ||||
| capwap/ac-descriptor/security : 2 | ||||
| capwap/ac-descriptor/software/vendor : 0 | ||||
| capwap/ac-descriptor/software/version: v0.0.1 | ||||
| capwap/ac-descriptor/station-limit: 1000 | ||||
| capwap/ac-descriptor/stations: 0 | ||||
|  | ||||
|  | ||||
| capwap-control-ip-address/address.0: 192.168.0.14 | ||||
| capwap/control-ip-address/address.0: 192.168.0.24 | ||||
|  | ||||
|  | ||||
|  | ||||
| # | ||||
| # CAPWAP Timers | ||||
| # | ||||
| capwap-timers/change-state-pending-timer: Word: 3 | ||||
| capwap-timers/data-check-timer: Word: 10 | ||||
| capwap-timers/echo-interval :Byte: 30 | ||||
| capwap-timers/max-discovery-interval :Byte: 10 | ||||
| capwap/timers/change-state-pending-timer: Word: 3 | ||||
| capwap/timers/data-check-timer: Word: 10 | ||||
| capwap/timers/echo-interval :Byte: 30 | ||||
| capwap/timers/max-discovery-interval :Byte: 10 | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -114,8 +114,10 @@ int dataman_process_keep_alive(struct netconn *nc, uint8_t *rawmsg, int len) | ||||
|  | ||||
| 			((uint16_t*)sessid)[0]=sessid_len; | ||||
| 			memcpy(bstr16_data(sessid),cw_get_elem_data(elem),sessid_len); | ||||
|  | ||||
| 			struct wtpman * wtpman = wtplist_get_by_session_id(sessid); | ||||
| 			 | ||||
| 			stop(); | ||||
| 			struct wtpman * wtpman =NULL; | ||||
| //			struct wtpman * wtpman = wtplist_get_by_session_id(sessid); | ||||
| 			if (wtpman){ | ||||
| 				if (!dm->wtpman) | ||||
| 					dm->wtpman=wtpman; | ||||
|  | ||||
| @ -203,7 +203,7 @@ int discovery_cache_get(struct cw_DiscoveryCache * cache,struct sockaddr *addr, | ||||
| 	{ | ||||
| 	cw_dbg(DBG_X,"DISCOVERY CACHE ---------------------------- DOUND BY ADDR"); | ||||
| 	char str[128]; | ||||
| 	sock_addrtostr(&elem->addr,str,128,1); | ||||
| 	sock_addrtostr((struct sockaddr*)&elem->addr,str,128,1); | ||||
| 	printf("ELEM addr: %s\n",str); | ||||
| 	} | ||||
|  | ||||
|  | ||||
							
								
								
									
										281
									
								
								src/ac/rpc.c
									
									
									
									
									
								
							
							
						
						
									
										281
									
								
								src/ac/rpc.c
									
									
									
									
									
								
							| @ -104,7 +104,9 @@ static void finish_cmd(FILE *f) | ||||
|  | ||||
| int prompt_cmd(struct rpcdata *sd, const char *cmd) | ||||
| { | ||||
| 	fprintf(sd->out,"actube[%s]:>\n","*"); | ||||
| 	const char *acname = cw_cfg_get(sd->global_cfg,"capwap/ac-name","actube"); | ||||
|  | ||||
| 	fprintf(sd->out,"%s[%s]:>\n",acname,sd->prompt); | ||||
| 	finish_cmd(sd->out); | ||||
| 	return 0; | ||||
| } | ||||
| @ -123,11 +125,14 @@ int select_cmd(struct rpcdata *sd, const char *cmd) | ||||
| 	char ap [CAPWAP_MAX_WTP_NAME_LEN]; | ||||
| 	sscanf(cmd,"%s",ap); | ||||
| 	strcpy(sd->prompt,ap); | ||||
| 	finish_cmd(sd->out); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| int list_cmd(struct rpcdata *sd, const char *cmd) | ||||
| { | ||||
| 	show_aps(sd->out); | ||||
| 	finish_cmd(sd->out); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| @ -135,8 +140,9 @@ int exit_cmd(struct rpcdata *sd, const char *cmd) | ||||
| { | ||||
| 		//fprintf(sd->out,"Unknown command: '%s'\n\r\n\r",cmd); | ||||
|  | ||||
| 	printf("Exitcmd %s\n",cmd); | ||||
| 	fprintf(sd->out,"END: %s\n\r",cmd); | ||||
| //	printf("Exitcmd %s\n",cmd); | ||||
| 	//fprintf(sd->out,"END: %s\n\r",cmd); | ||||
| 	finish_cmd(sd->out); | ||||
| 	fflush(sd->out); | ||||
| 	return 1; | ||||
| } | ||||
| @ -152,9 +158,9 @@ int cfg_cmd(struct rpcdata *sd, const char *cmd) | ||||
| 		fprintf(sd->out,"WTP '%s' not found\n",sd->prompt); | ||||
| 	} | ||||
| 	else { | ||||
| 		stop(); | ||||
| //		show_cfg(sd->out,conn->remote_cfg); | ||||
| 		cw_cfg_fdump(sd->out,conn->remote_cfg); | ||||
| 	} | ||||
| 	finish_cmd(sd->out); | ||||
| 	wtplist_unlock(); | ||||
| 	return 0; | ||||
| } | ||||
| @ -209,20 +215,24 @@ wlan0_cmd(struct rpcdata * sd, const char *cmd) | ||||
|  | ||||
| int set_cmd(struct rpcdata *sd, const char *str) | ||||
| { | ||||
| /*	struct cw_Conn * conn; | ||||
| 	struct cw_Val_Reader r; | ||||
| 	char key[CW_CFG_MAX_KEY_LEN]; | ||||
| 	char type[CW_CFG_MAX_KEY_LEN]; | ||||
| 	char val[2048]; | ||||
| */ | ||||
| 	stop(); | ||||
|  | ||||
| 	cw_Cfg_t *cfg; | ||||
| 	cfg = cw_cfg_create(); | ||||
|  | ||||
| 	cw_cfg_read_from_string(str,cfg); | ||||
|  | ||||
| 	cw_cfg_fdump(sd->out,cfg); | ||||
|  | ||||
| 	cw_cfg_destroy(cfg); | ||||
|  | ||||
| 	finish_cmd(sd->out); | ||||
|  | ||||
| //	cw_ktv_init_str_reader(&r,str,strlen(str)); | ||||
| 	 | ||||
| //	cw_ktv_parse_string(&r,key,type,val); | ||||
| 	/*cw_ktv_parse_string(key,type,val, 2048);*/ | ||||
| 	 | ||||
| //	fprintf(sd->out,"%s :%s: %s\n",key,type,val); | ||||
| //	fprintf(sd->out,"%s %s\n",key,val); | ||||
| //	cw_ktv_add(sd->update_cfg,key,CW_TYPE_STR,NULL,val,strlen(val)); | ||||
| 	return 0; | ||||
| } | ||||
| @ -262,10 +272,28 @@ void show_cfg (FILE *out, mavl_t ktv) | ||||
| } | ||||
| */ | ||||
|  | ||||
|  | ||||
| void print_mw(FILE *f, int w, const char * str) | ||||
| { | ||||
| 	int n,i; | ||||
| 	fprintf(f, "%.*s",w,str); | ||||
| 	n=strlen(str); | ||||
|  | ||||
| 	if ( n>w ){ | ||||
| 		fprintf(f,"> "); | ||||
| 		return; | ||||
| 	} | ||||
| 	n = w-n; | ||||
|  | ||||
| 	for(i=0;i<(n+2);i++){ | ||||
| 		fprintf(f,"%c",' '); | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
| int  show_aps (FILE *out) | ||||
| { | ||||
| 	stop(); | ||||
| /*	struct connlist * cl; | ||||
| 	struct connlist * cl; | ||||
| 	mavliter_t it; | ||||
| 	wtplist_lock(); | ||||
| 	 | ||||
| @ -273,31 +301,29 @@ int  show_aps (FILE *out) | ||||
| 	 | ||||
| 	 | ||||
| 	mavliter_init (&it, cl->by_addr); | ||||
| 	fprintf (out, "IP\t\t\twtp-name\n"); | ||||
| 	print_mw (out, 16, "AP Name"); | ||||
| 	print_mw (out, 16, "AP Model"); | ||||
| 	print_mw (out, 14, "Vendor"); | ||||
| 	print_mw (out, 16, "IP "); | ||||
| 	fprintf(out,"\n"); | ||||
|  | ||||
| 	mavliter_foreach (&it) { | ||||
| 		cw_Val_t * result; | ||||
| 		char addr[SOCK_ADDR_BUFSIZE]; | ||||
| 		char wtp_name[CAPWAP_MAX_WTP_NAME_LEN]; | ||||
| 		const char *vendor; | ||||
|  | ||||
| 		struct cw_Conn * conn; | ||||
| 		conn = mavliter_get_ptr (&it); | ||||
| 		 | ||||
| 		sock_addr2str_p (&conn->addr, addr); | ||||
|  | ||||
| 		stop();		 | ||||
| //		result = cw_ktv_get (conn->remote_cfg, "wtp-name", NULL); | ||||
| 		 | ||||
| 		if (result == NULL) { | ||||
| 			strcpy (wtp_name, ""); | ||||
| 			 | ||||
| 		} else { | ||||
| 			result->type->to_str (result, wtp_name, CAPWAP_MAX_WTP_NAME_LEN); | ||||
| 		} | ||||
| 		 | ||||
| 		 | ||||
| 		fprintf (out, "%s\t\t%s\n", addr, wtp_name); | ||||
| 		print_mw(out,16,cw_cfg_get(conn->remote_cfg, "capwap/wtp-name", "Unknown")); | ||||
| 		print_mw(out,16,cw_cfg_get(conn->remote_cfg, "capwap/wtp-board-data/model-no", "Unknown")); | ||||
| 		vendor = cw_cfg_get(conn->remote_cfg, "capwap/wtp-board-data/vendor", "0"); | ||||
| 		print_mw(out,14,vendor);	 | ||||
| 		sock_addr2str_p (&conn->addr, addr); | ||||
| 		print_mw(out,16,addr); | ||||
| 		fprintf(out,"\n"); | ||||
|  | ||||
| 	} | ||||
| 	wtplist_unlock(); | ||||
| 	*/ | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| @ -305,40 +331,30 @@ int  show_aps (FILE *out) | ||||
|  | ||||
| struct cw_Conn * find_ap(const char *name) | ||||
| { | ||||
| stop(); | ||||
| /*	 | ||||
| 	 | ||||
| 	struct connlist * cl; | ||||
| 	mavliter_t it; | ||||
|  | ||||
| 	cl = wtplist_get_connlist(); | ||||
| 	 | ||||
| 	 | ||||
| 	mavliter_init (&it, cl->by_addr); | ||||
| 	mavliter_foreach (&it) { | ||||
| 		cw_Val_t * result; | ||||
| 		char wtp_name[CAPWAP_MAX_WTP_NAME_LEN]; | ||||
| 		const char *wtpname; | ||||
| 		struct cw_Conn * conn; | ||||
| 		conn = mavliter_get_ptr (&it); | ||||
| 		 | ||||
| 		result = cw_ktv_get (conn->remote_cfg, "wtp-name", NULL); | ||||
| 		wtpname = cw_cfg_get (conn->remote_cfg, "capwap/wtp-name", NULL); | ||||
| 		 | ||||
| 		if (result == NULL) { | ||||
| 			strcpy (wtp_name, ""); | ||||
| 			 | ||||
| 		} else { | ||||
| 			result->type->to_str (result, wtp_name, CAPWAP_MAX_WTP_NAME_LEN); | ||||
| 		} | ||||
| 	 | ||||
| 		printf("cmp '%s' : '%s'\n",wtp_name,name); | ||||
| 		if (wtpname == NULL) | ||||
| 			continue; | ||||
| 		 | ||||
| 		if(strcmp(wtp_name,name)==0){ | ||||
| 		if(strcmp(wtpname,name)==0){ | ||||
| 			return conn; | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
| 	return NULL; | ||||
| 	*/ | ||||
| 	/*wtplist_unlock();*/ | ||||
| 	 | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -400,16 +416,20 @@ void con (FILE *out) | ||||
|  | ||||
| struct command * find_cmd(const char *cmd) | ||||
| { | ||||
| 	struct command * search; | ||||
| 	struct command * search,*result; | ||||
| 	 | ||||
| 	result=NULL; | ||||
| 	search = cmdlist; | ||||
| 	while (search->cmd!=NULL){ | ||||
| 		if (strncmp(cmd,search->cmd,strlen(cmd))==0){ | ||||
| 			return search; | ||||
| 			if (result==NULL) | ||||
| 				result = search; | ||||
| 			else  | ||||
| 				return NULL; | ||||
| 		} | ||||
| 		search ++; | ||||
| 	} | ||||
| 	return NULL; | ||||
| 	return result; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -434,7 +454,6 @@ int execute_cmd (struct rpcdata * sd, const char *str) | ||||
| 		} | ||||
| 	} | ||||
| 	else{ | ||||
| 		printf("unknow command\n"); | ||||
| 		fprintf(sd->out,"Unknown command: '%s'\n",cmd); | ||||
| 		finish_cmd(sd->out); | ||||
| 	} | ||||
| @ -506,147 +525,8 @@ struct esc_strings estr[] = { | ||||
|  | ||||
| }; | ||||
|  | ||||
| static int cmpansi(char * str,char * ansistr) | ||||
| { | ||||
| 	int sl,al; | ||||
| 	sl = strlen(str); | ||||
| 	al = strlen(ansistr); | ||||
|  | ||||
|  | ||||
| 	if(sl>al){ | ||||
| 		return 0; | ||||
| 	} | ||||
| 	if (sl<al){ | ||||
| 		if (strncmp(str,ansistr,sl)==0) | ||||
| 			return -1; | ||||
| 	} | ||||
|  | ||||
| 	if (strcmp(str,ansistr)==0) | ||||
| 		return 1; | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| static void get_line_char_mode(FILE * file, struct rpcdata *sd) | ||||
| { | ||||
| 	int c; | ||||
| 	struct esc_strings * es; | ||||
|  | ||||
| 	es = NULL; | ||||
| 	sd->line[0]=0; | ||||
| 	sd->pos=0; | ||||
| 	sd->esc[0]=0; | ||||
| 	sd->escpos=0; | ||||
|  | ||||
| //	fprintf (file, "\xff\xfc\22"); | ||||
|  | ||||
| 	/* Put telnet into char mode */ | ||||
| 	fprintf (file,"%c%c%c",IAC,WILL,TELOPT_ECHO ); | ||||
| 	fprintf (file,"%c%c%c",IAC,WILL,TELOPT_SGA ); | ||||
| 	fprintf (file,"%c%c%c",IAC,DONT,TELOPT_LINEMODE ); | ||||
|  | ||||
|  | ||||
| 	fprintf (file, "actube[%s]:>", sd->prompt); | ||||
| 	fflush (file); | ||||
|  | ||||
| 	while ( (c=fgetc(file))!= EOF){ | ||||
| 		printf ("%02x\n",c); | ||||
| 		if (sd->escpos){ | ||||
| 			int i; | ||||
| 			int a=0; | ||||
|  | ||||
| 			sd->esc[sd->escpos++]=c; | ||||
| 			sd->esc[sd->escpos]=0; | ||||
|  | ||||
| 			for (i=0; estr[i].str != NULL; i++){ | ||||
| 				int rc; | ||||
| 				rc = cmpansi(sd->esc,estr[i].str); | ||||
| 				if (rc==1){ | ||||
| 					sd->esc[0]=0; | ||||
| 					sd->escpos=0; | ||||
| 					es = &estr[i]; | ||||
| 					break; | ||||
| 				} | ||||
| 				a |= rc; | ||||
| 					 | ||||
| 			} | ||||
| 			if (a==0){ | ||||
| 				sd->esc[0]=0; | ||||
| 				sd->escpos=0; | ||||
| 			}else{ | ||||
| 				continue; | ||||
| 			} | ||||
|  | ||||
|  | ||||
| 		} | ||||
| 		if (c==0x1b){ | ||||
| 			sd->esc[sd->escpos++]=c; | ||||
| 			sd->esc[sd->escpos]=0; | ||||
| 			printf("ESC start\n"); | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
|  | ||||
| 		if (!es){ | ||||
| 			if (c=='\r'){ | ||||
| 				printf("CMD: %s\n",sd->line); | ||||
| 				fprintf (file, "\n\r"); | ||||
| 				fflush(file); | ||||
| 				//fprintf (file, "\n\ractube[%s]:>", sd->prompt); | ||||
| 				return; | ||||
| 				sd->pos=0; | ||||
| 				sd->line[0]=0; | ||||
| 				continue; | ||||
| 			} | ||||
| 			if (c=='\x7f'){ | ||||
| 				if (sd->pos==0) | ||||
| 					continue; | ||||
|  | ||||
| 				printf("Backspace\n"); | ||||
| 				fprintf(file,"%c %c",8,8); | ||||
| 				sd->line[--sd->pos]=0; | ||||
| 				continue; | ||||
|  | ||||
| 			} | ||||
| 			if (c>240 || c<30){ | ||||
| 				continue; | ||||
| 			} | ||||
|  | ||||
|  | ||||
| 			sd->line[sd->pos++]=c; | ||||
| 			sd->line[sd->pos]=0; | ||||
| 			printf("putout: %c %02X\n",c,c); | ||||
| 			fprintf(file,"\x1b[1@%c",c); | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
| 		printf ("ES: %s\n",es->result); | ||||
|  | ||||
| 		if (strcmp(es->result,"left")==0){ | ||||
| 			if (sd->pos>0){ | ||||
| 				sd->pos--; | ||||
| 				fprintf(file,"%s",es->str); | ||||
| 			} | ||||
| 		} | ||||
| 		if (strcmp(es->result,"right")==0){ | ||||
| 			if (sd->line[sd->pos]!=0){ | ||||
| 				sd->pos++; | ||||
| 				fprintf(file,"%s",es->str); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| //		fprintf(file,es->str); | ||||
|  | ||||
| 		es = NULL; | ||||
| //		fflush(file); | ||||
|  | ||||
|  | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
| void rpc_loop (FILE *file, cw_Cfg_t *global_cfg) | ||||
| @ -666,7 +546,6 @@ void rpc_loop (FILE *file, cw_Cfg_t *global_cfg) | ||||
| 	sd.quit=0; | ||||
|  | ||||
| 	do { | ||||
| 		int c; | ||||
|  | ||||
| 		str[0]=0; | ||||
| 		 | ||||
| @ -722,13 +601,11 @@ void * run_rpc_server (void * arg) | ||||
|  | ||||
| int create_tcp_fd(const char *name) | ||||
| { | ||||
| 	struct sockaddr_storage server, client; | ||||
| 	socklen_t client_size; | ||||
| 	char sockstr[SOCK_ADDR_BUFSIZE]; | ||||
| 	struct sockaddr_storage server; //, client; | ||||
| 	 | ||||
| 	int rc; | ||||
| 	const char * addr = name; | ||||
| 	int sockfd, clientsock; | ||||
| 	int sockfd; | ||||
| 	int yes; | ||||
| 	 | ||||
| 	rc = sock_strtoaddr (addr, (struct sockaddr*) &server); | ||||
| @ -756,8 +633,8 @@ int create_tcp_fd(const char *name) | ||||
| } | ||||
| static int create_unix_fd(const char *name) | ||||
| { | ||||
|         struct sockaddr_storage client; | ||||
| 	socklen_t client_size; | ||||
|         //struct sockaddr_storage client; | ||||
| 	//socklen_t client_size; | ||||
| 	struct sockaddr_un addr; | ||||
| 	int rc,fd; | ||||
|  | ||||
| @ -771,7 +648,7 @@ static int create_unix_fd(const char *name) | ||||
| 		cw_log (LOG_ERR, "Can't bind socket 'unix:%s', %s", name, strerror (errno)); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	int clientsock = accept (fd, (struct sockaddr*) &client, &client_size); | ||||
| 	//int clientsock = accept (fd, (struct sockaddr*) &client, &client_size); | ||||
|  | ||||
| 	return fd; | ||||
| } | ||||
| @ -780,7 +657,7 @@ int start_rpc(cw_Cfg_t *global_cfg) | ||||
| { | ||||
| 	struct sockdata * sockdata; | ||||
| 	const char *sockname; | ||||
| 	int rc, type; | ||||
| 	int rc; //, type; | ||||
| 	int fd; | ||||
|  | ||||
| 	rc = cw_cfg_get_bool(global_cfg,"actube/rpc/enable",1); | ||||
|  | ||||
| @ -131,7 +131,7 @@ struct mavl * cw_statemachine_load_states (struct mavl * statemachine_states, cw | ||||
|                         cw_strstate(s->state)); | ||||
|                 s++; | ||||
|         } | ||||
|         return 1; | ||||
|         return NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -78,7 +78,7 @@ struct wtpman * wtplist_get(const struct sockaddr * addr) | ||||
|  | ||||
| } | ||||
|  | ||||
| struct wtpman * wtplist_get_by_session_id(bstr16_t *session_id) | ||||
| struct wtpman * wtplist_get_by_session_id(bstr16_t session_id) | ||||
| { | ||||
| 	struct cw_Conn  search; | ||||
| 	struct cw_Conn * conn; | ||||
|  | ||||
| @ -13,7 +13,7 @@ extern struct wtpman * wtplist_add(struct wtpman * wtpman); | ||||
| extern void wtplist_remove(struct wtpman * wtpman); | ||||
| extern void wtplist_lock(); | ||||
| extern void wtplist_unlock(); | ||||
| extern struct wtpman * wtplist_get_by_session_id(bstr16_t *session_id); | ||||
| extern struct wtpman * wtplist_get_by_session_id(bstr16_t session_id); | ||||
| struct connlist * wtplist_get_connlist(void); | ||||
|  | ||||
| #endif | ||||
|  | ||||
							
								
								
									
										237
									
								
								src/ac/wtpman.c
									
									
									
									
									
								
							
							
						
						
									
										237
									
								
								src/ac/wtpman.c
									
									
									
									
									
								
							| @ -166,7 +166,7 @@ static int wtpman_join(void *arg) | ||||
|  | ||||
|  | ||||
|  | ||||
| static void wtpman_image_data(struct wtpman *wtpman) | ||||
| void wtpman_image_data(struct wtpman *wtpman) | ||||
| { | ||||
| /*	char sock_buf[SOCK_ADDR_BUFSIZE]; | ||||
| 	struct cw_Conn *conn = wtpman->conn; | ||||
| @ -300,12 +300,12 @@ int cw_run_state_machine(struct cw_Conn *conn, time_t * timer) | ||||
|  | ||||
| static void *wtpman_main(void *arg) | ||||
| { | ||||
| 	mavl_t r; | ||||
| 	//mavl_t r; | ||||
| 	int rc; | ||||
| 	time_t timer; | ||||
| 	char sock_buf[SOCK_ADDR_BUFSIZE]; | ||||
| 	//char sock_buf[SOCK_ADDR_BUFSIZE]; | ||||
| 	struct cw_Conn *conn; | ||||
| 	int last_state; | ||||
| //	int last_state; | ||||
| 	struct wtpman *wtpman = (struct wtpman *) arg; | ||||
|  | ||||
| 	wtpman->conn->seqnum = 0; | ||||
| @ -346,8 +346,8 @@ static void *wtpman_main(void *arg) | ||||
|  | ||||
| 	while (1) { | ||||
|  | ||||
| 		int wait_join; | ||||
| 		int wait_change_state; | ||||
| 		//int wait_join; | ||||
| 		//int wait_change_state; | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -397,7 +397,7 @@ static void *wtpman_main(void *arg) | ||||
|  | ||||
|  | ||||
| 	/* dtls is established, goto join state */ | ||||
|  | ||||
| /* | ||||
| 	conn->capwap_state = CAPWAP_STATE_JOIN; | ||||
| 	if (!wtpman_join(wtpman)) { | ||||
| 		wtpman_remove(wtpman); | ||||
| @ -410,182 +410,14 @@ static void *wtpman_main(void *arg) | ||||
| 	       sock_addr2str_p(&conn->addr, sock_buf), | ||||
| 	       format_bin2hex(conn->session_id, 16)); | ||||
|  | ||||
| */ | ||||
|  | ||||
| 	exit(0); | ||||
|  | ||||
| /* | ||||
| //	cw_dbg(DBG_INFO, "Creating data thread"); | ||||
| //	pthread_t thread; | ||||
| //	pthread_create(&thread, NULL, (void *) wtpman_run_data, (void *) wtpman); | ||||
| */ | ||||
|  | ||||
| 	/* here the WTP has joined, now we assume an image data request   | ||||
| 	   or a configuration status request. Nothing else.  | ||||
| 	 */ | ||||
|  | ||||
| 	rc = 0; | ||||
| 	while (!cw_timer_timeout(timer) | ||||
| 	       && wtpman->conn->capwap_state == CAPWAP_STATE_CONFIGURE) { | ||||
| 		rc = cw_read_messages(wtpman->conn); | ||||
| 		if (rc < 0) { | ||||
| 			if (errno != EAGAIN) | ||||
| 				break; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	cw_dbg_ktv_dump(conn->remote_cfg, DBG_INFO, | ||||
| 			"-------------dump------------", "DMP", | ||||
| 			"---------end dump --------"); | ||||
|  | ||||
| 	if (!cw_result_is_ok(rc)) { | ||||
| 		cw_dbg(DBG_INFO, "WTP Problem: %s", cw_strrc(rc)); | ||||
| 		wtpman_remove(wtpman); | ||||
| 		return NULL; | ||||
|  | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	if (conn->capwap_state == CW_STATE_IMAGE_DATA) { | ||||
| 		wtpman_image_data(wtpman); | ||||
| 		return NULL; | ||||
| 	} | ||||
|  | ||||
|  | ||||
|  | ||||
| 	conn->capwap_state = CAPWAP_STATE_RUN; | ||||
| /* | ||||
| 	// XXX testing ... | ||||
| //	DBGX("Cofig to sql", ""); | ||||
| //	props_to_sql(conn,conn->incomming,0); | ||||
| //	radios_to_sql(conn); | ||||
| */ | ||||
|  | ||||
| 	/*conn->msg_end=msg_end_handler; */ | ||||
| 	/* The main run loop */ | ||||
| 	reset_echointerval_timer(wtpman); | ||||
|  | ||||
| 	rc = 0; | ||||
| 	while (wtpman->conn->capwap_state == CAPWAP_STATE_RUN) { | ||||
| 		rc = cw_read_messages(wtpman->conn); | ||||
| 		if (rc < 0) { | ||||
| 			if (errno != EAGAIN) | ||||
| 				break; | ||||
| 		} | ||||
|  | ||||
| /*//		cw_dbg(DBG_X, "Time left: %d", | ||||
| // */ | ||||
| 		/*cw_timer_timeleft(wtpman->echointerval_timer); */ | ||||
|  | ||||
| 		if (cw_timer_timeout(wtpman->echointerval_timer)) { | ||||
|  | ||||
| 			cw_dbg(DBG_INFO, "Lost connection to WTP:%s", | ||||
| 			       sock_addr2str_p(&conn->addr, sock_buf)); | ||||
| 			break; | ||||
| 		} | ||||
| /* | ||||
| //		mavl_del_all(conn->outgoing); | ||||
| //		conn_clear_upd(conn,1); | ||||
|  | ||||
| //	props_to_sql(conn,conn->incomming,0); | ||||
| //	radios_to_sql(conn); | ||||
| */ | ||||
|  | ||||
|  | ||||
|  | ||||
| 		r = db_get_update_tasks(conn, | ||||
| 					sock_addr2str(&conn->addr, sock_buf)); | ||||
| 		if (r) { | ||||
|  | ||||
| 			/*               | ||||
| 			   //                   if (!conn->outgoing->count) | ||||
| 			   //                           continue; | ||||
| 			 */ | ||||
| 			cw_dbg(DBG_INFO, "Updating WTP %s", | ||||
| 			       sock_addr2str(&conn->addr, sock_buf)); | ||||
|  | ||||
| 			rc = cw_send_request(conn, | ||||
| 					     CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST); | ||||
|  | ||||
| /* | ||||
| //			mavl_merge(conn->config, conn->outgoing); | ||||
| //			mavl_destroy(conn->outgoing); | ||||
| //			conn->outgoing = mbag_create(); | ||||
| //			props_to_sql(conn,conn->incomming,0); | ||||
| //			radios_to_sql(conn); | ||||
| //			mavl_destroy(r); | ||||
| */ | ||||
| 		} | ||||
|  | ||||
| 		r = db_get_radio_tasks(conn, | ||||
| 				       sock_addr2str(&conn->addr, sock_buf)); | ||||
| 		if (r) { | ||||
|  | ||||
| /* | ||||
| 			//			if (!conn->radios_upd->count) | ||||
| //				continue; | ||||
| */ | ||||
| 			cw_dbg(DBG_INFO, "Updating Radios for %s", | ||||
| 			       sock_addr2str(&conn->addr, sock_buf)); | ||||
| 			rc = cw_send_request(conn, | ||||
| 					     CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST); | ||||
|  | ||||
| /* | ||||
| //			conn_clear_upd(conn,1); | ||||
|  | ||||
| //			mavl_destroy(conn->radios_upd); | ||||
| //			conn->radios_upd=mbag_i_create(); | ||||
|  | ||||
|  | ||||
| //			radios_to_sql(conn); | ||||
| */ | ||||
| 			/* | ||||
| 			   rc = cw_send_request(conn, CW_MSG_CONFIGURATION_UPDATE_REQUEST); | ||||
| 			   mavl_merge(conn->config, conn->outgoing); | ||||
| 			   mavl_destroy(conn->outgoing); | ||||
| 			   conn->outgoing = mbag_create(); | ||||
| 			   config_to_sql(conn); | ||||
| 			   radios_to_sql(conn); | ||||
| 			   mavl_destroy(r); | ||||
| 			 */ | ||||
| 		} | ||||
|  | ||||
|  | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	db_ping_wtp(sock_addr2str_p(&conn->addr, sock_buf), ""); | ||||
| 	wtpman_remove(wtpman); | ||||
| 	return NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void wtpman_run_dtls(void *arg) | ||||
| { | ||||
| 	char sock_buf[SOCK_ADDR_BUFSIZE]; | ||||
| 	struct wtpman *wtpman = (struct wtpman *) arg; | ||||
|  | ||||
|  | ||||
|  | ||||
| 	/* reject connections to our multi- or broadcast sockets */ | ||||
| 	if (socklist[wtpman->socklistindex].type != SOCKLIST_UNICAST_SOCKET) { | ||||
| 		cw_dbg(DBG_DTLS, | ||||
| 		       "Dropping connection from %s to non-unicast socket.", | ||||
| 		       sock_addr2str_p(&wtpman->conn->addr, sock_buf)); | ||||
| 		wtpman_remove(wtpman); | ||||
| 		return; | ||||
| 	} | ||||
| /*//      time_t timer = cw_timer_start(wtpman->conn->wait_dtls);*/ | ||||
|  | ||||
| 	/* establish dtls session */ | ||||
| 	if (!wtpman_dtls_setup(wtpman)) { | ||||
| 		wtpman_remove(wtpman); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	wtpman_main(arg); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| void wtpman_destroy(struct wtpman *wtpman) | ||||
| { | ||||
| @ -601,10 +433,10 @@ void wtpman_destroy(struct wtpman *wtpman) | ||||
|  | ||||
| static void copy(struct cw_ElemHandlerParams * params) | ||||
| { | ||||
| 	struct wtpman * wtpman; | ||||
| 	struct cw_Conn * conn; | ||||
| 	wtpman = (struct wtpman*)params->conn->data; | ||||
| 	conn = (struct cw_Conn*)params->conn; | ||||
| //	struct wtpman * wtpman; | ||||
| 	//struct cw_Conn * conn; | ||||
| 	//wtpman = (struct wtpman*)params->conn->data; | ||||
| 	//conn = (struct cw_Conn*)params->conn; | ||||
|  | ||||
|  | ||||
| //	cw_dbg(DBG_X,"-------------  Here is the config we ve got from WTP ---------------- "); | ||||
| @ -612,16 +444,24 @@ static void copy(struct cw_ElemHandlerParams * params) | ||||
| //	cw_dbg(DBG_X,"-------------  This was the config we ve got from WTP ---------------- "); | ||||
| //	cw_dbg(DBG_X,"Now copying:"); | ||||
| //	cw_cfg_copy(params->cfg,conn->local_cfg,0,""); | ||||
|         cw_cfg_copy(params->cfg, params->conn->local_cfg,DBG_CFG_UPDATES,"GlobalCfg"); | ||||
|         cw_cfg_copy(params->cfg, params->conn->remote_cfg,DBG_CFG_UPDATES,"GlobalCfg"); | ||||
|  | ||||
| //	cw_dbg(DBG_X,"Copying done."); | ||||
| } | ||||
|  | ||||
| static int discovery_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len) | ||||
| { | ||||
| 	struct cw_Conn * conn = (struct cw_Conn*)params->conn; | ||||
| 	char filename[200]; | ||||
|  | ||||
| 	cw_dbg(DBG_X,"DISCOVERY Callback"); | ||||
| 	copy(params); | ||||
|  | ||||
| 	const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default"); | ||||
| 	sprintf(filename,"wtp-discovery-%s.ckv",wtpname); | ||||
| 	cw_cfg_save(filename,params->cfg,NULL); | ||||
| 	cw_cfg_clear(params->cfg); | ||||
| 		 | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| @ -632,7 +472,7 @@ static int join_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, in | ||||
|  | ||||
| 	cw_dbg(DBG_X,"JOIN Callback"); | ||||
| 	copy(params); | ||||
| 	const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default"); | ||||
| 	const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default"); | ||||
| 	sprintf(filename,"wtp-join-%s.ckv",wtpname); | ||||
| 	cw_cfg_save(filename,params->cfg,NULL); | ||||
| 	cw_cfg_clear(params->cfg); | ||||
| @ -649,7 +489,7 @@ static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, | ||||
| 	cw_dbg(DBG_X,"UPDATE Callback"); | ||||
| 	copy(params); | ||||
|  | ||||
| 	const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default"); | ||||
| 	const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default"); | ||||
| 	sprintf(filename,"wtp-status-%s.ckv",wtpname); | ||||
| 	cw_cfg_save(filename,params->cfg,NULL); | ||||
| //stop();	 | ||||
| @ -666,9 +506,9 @@ static int event_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, i | ||||
| 	cw_dbg(DBG_X,"WTP EVENT Callback"); | ||||
| 	copy(params); | ||||
|  | ||||
| 	const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default"); | ||||
| 	sprintf(filename,"wtp-status-%s.ckv",wtpname); | ||||
| 	cw_cfg_save(filename,params->cfg,NULL); | ||||
| 	const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default"); | ||||
| 	sprintf(filename,"wtp-event-%s.ckv",wtpname); | ||||
| 	cw_cfg_save(filename,conn->remote_cfg,NULL); | ||||
| //stop();	 | ||||
| 	return 0; | ||||
| } | ||||
| @ -676,16 +516,6 @@ static int event_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, i | ||||
|  | ||||
|  | ||||
|  | ||||
| static setup_complete(struct cw_Conn *conn) | ||||
| { | ||||
| 	struct wtpman * wtpman = (struct wtpman *)conn->data; | ||||
| //	wtpman->pjoin = cw_msgset_set_postprocess(conn->msgset,CAPWAP_MSG_JOIN_REQUEST,join_cb); | ||||
| //	wtpman->pupdate = cw_msgset_set_postprocess(conn->msgset,CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,update_cb); | ||||
| 	cw_dbg(DBG_X,"SETUP COMPLETE"); | ||||
|  | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr, | ||||
| 			     int dtlsmode, cw_Cfg_t * global_cfg) | ||||
| @ -730,7 +560,7 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr, | ||||
|  | ||||
| 	wtpman->global_cfg = global_cfg; | ||||
|  | ||||
| 	wtpman->conn = cw_conn_create(sockfd, srcaddr, 5); | ||||
| 	wtpman->conn = cw_conn_create(sockfd, srcaddr, 100); | ||||
| 	if (!wtpman->conn) { | ||||
| 		wtpman_destroy(wtpman); | ||||
| 		return NULL; | ||||
| @ -743,6 +573,13 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr, | ||||
| 	wtpman->conn->role = CW_ROLE_AC; | ||||
| 	wtpman->conn->data=wtpman; | ||||
|  | ||||
| 	wtpman->conn->cfg_list[0]=wtpman->conn->update_cfg; | ||||
| 	wtpman->conn->cfg_list[1]=wtpman->conn->remote_cfg; | ||||
| 	wtpman->conn->cfg_list[2]=wtpman->conn->local_cfg; | ||||
| 	wtpman->conn->cfg_list[3]=wtpman->conn->global_cfg; | ||||
| 	wtpman->conn->cfg_list[4]=NULL; | ||||
|  | ||||
|  | ||||
| 	wtpman->conn->data_sock = socklist[socklistindex].data_sockfd; | ||||
| 	sock_copyaddr(&wtpman->conn->data_addr, | ||||
| 		      (struct sockaddr *) &wtpman->conn->addr); | ||||
| @ -771,7 +608,7 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr, | ||||
| 	wtpman->conn->strict_capwap = conf_strict_capwap; | ||||
| 	wtpman->conn->strict_hdr = conf_strict_headers; | ||||
|  | ||||
| 	wtpman->conn->setup_complete = setup_complete; | ||||
| //	wtpman->conn->setup_complete = setup_complete; | ||||
| /* | ||||
| //	wtpman->conn->radios = mbag_i_create(); | ||||
| //	wtpman->conn->radios_upd = mbag_i_create(); | ||||
| @ -799,8 +636,8 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr, | ||||
| 			    cw_mod_get_msg_set(wtpman->conn, cmod, bmod); | ||||
| 			wtpman->conn->detected = 1; | ||||
| 			cmod->setup_cfg(wtpman->conn); | ||||
| 	               if (wtpman->conn->setup_complete) | ||||
|         	                wtpman->conn->setup_complete(wtpman->conn); | ||||
| //	               if (wtpman->conn->setup_complete) | ||||
| //        	                wtpman->conn->setup_complete(wtpman->conn); | ||||
|  | ||||
|  | ||||
| 		} | ||||
|  | ||||
| @ -83,10 +83,17 @@ enum radioelems { | ||||
| 	CW_ELEM80211_WTP_RADIO_CONFIGURATION=1046, | ||||
| 	/** IEEE 802.11 WTP Radio Fail Alarm Indication */ | ||||
| 	CW_ELEM80211_WTP_RADIO_FAIL_ALARM_IDICATION=1047, | ||||
| 	/** IEEE 802.11 Radio Information Message Element */ | ||||
| 	CAPWAP80211_ELEM_WTP_RADIO_INFORMATION = 1048 | ||||
| }; | ||||
|  | ||||
|  | ||||
| /** IEEE 802.11 Radio Information Message Element */ | ||||
| #define CAPWAP80211_ELEM_WTP_RADIO_INFORMATION		1048 | ||||
| /** IEEE 802.11 Antenna Message element */ | ||||
| #define CAPWAP80211_ELEM_ANTENNA			1025 | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  *@} | ||||
|  */ | ||||
|  | ||||
							
								
								
									
										19
									
								
								src/cw/cfg.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								src/cw/cfg.c
									
									
									
									
									
								
							| @ -495,6 +495,21 @@ int cw_cfg_load(const char *filename, cw_Cfg_t * cfg) | ||||
| 	return errno; | ||||
| } | ||||
|  | ||||
| int cw_cfg_read_from_string(const char *str, cw_Cfg_t *cfg) | ||||
| { | ||||
| 	int errs; | ||||
| 	FILE * f = fmemopen((void*)str,strlen(str),"rb"); | ||||
| 	if(!f) | ||||
| 		return errno; | ||||
| 	errs = cw_cfg_read_from_file(f, cfg); | ||||
| 	fclose(f); | ||||
|  | ||||
| 	if (errs) | ||||
| 		errno = EINVAL; | ||||
| 	return errno; | ||||
|  | ||||
| } | ||||
|  | ||||
| int cw_cfg_write_to_file(FILE *f, cw_Cfg_t * cfg) | ||||
| { | ||||
| 	mavliter_t it; | ||||
| @ -625,7 +640,7 @@ uint8_t cw_cfg_get_byte_l(cw_Cfg_t ** cfgs, char *key, uint8_t def) | ||||
|  | ||||
|  | ||||
|  | ||||
| uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def) | ||||
| uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, const char *key, uint16_t def) | ||||
| { | ||||
| 	struct cw_Val v; | ||||
| 	const char *s = cw_cfg_get(cfg,key,NULL); | ||||
| @ -635,7 +650,7 @@ uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def) | ||||
| 	return v.val.word; | ||||
| } | ||||
|  | ||||
| uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, char *key, uint16_t def) | ||||
| uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, const char *key, uint16_t def) | ||||
| { | ||||
| 	struct cw_Val v; | ||||
| 	const char *s = cw_cfg_get_l(cfg,key,NULL); | ||||
|  | ||||
| @ -39,7 +39,7 @@ struct cw_Cfg_entry *cw_cfg_iter_next(struct cw_Cfg_iter *cfi, const char *key); | ||||
| void cw_cfg_iter_init(cw_Cfg_t * cfg, struct cw_Cfg_iter *cfi, const char *base); | ||||
|  | ||||
| int cw_cfg_get_bool(cw_Cfg_t * cfg, const char * key, int def); | ||||
| uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def); | ||||
| uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, const char *key, uint16_t def); | ||||
| void cw_cfg_set_int(cw_Cfg_t * cfg, const char * key, int val); | ||||
| uint8_t cw_cfg_get_byte(cw_Cfg_t * cfg, char *key, uint8_t def); | ||||
| bstr16_t cw_cfg_get_bstr16(cw_Cfg_t * cfg, const char * key, const char *def); | ||||
| @ -55,8 +55,9 @@ cw_Val_t * cw_cfg_get_val_l(cw_Cfg_t ** cfgs, const char *key, const struct cw_T | ||||
| int cw_cfg_base_exists_l(cw_Cfg_t ** cfgs, const char *key); | ||||
| int cw_cfg_save(const char *filename, cw_Cfg_t *cfg, const char *format, ...); | ||||
|  | ||||
| uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, char *key, uint16_t def); | ||||
| uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, const char *key, uint16_t def); | ||||
| void cw_cfg_fdump(FILE *f, cw_Cfg_t * cfg); | ||||
| int cw_cfg_read_from_string(const char *str, cw_Cfg_t *cfg); | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -61,6 +61,7 @@ void cw_conn_init(struct cw_Conn * conn) | ||||
| 	conn->update_cfg = cw_cfg_create(); | ||||
| 	conn->remote_cfg = cw_cfg_create(); | ||||
| 	conn->local_cfg = cw_cfg_create(); | ||||
| 	conn->cfg_list[0]=NULL; | ||||
| } | ||||
|  | ||||
| int cw_conn_set_msg_cb(struct cw_Conn *conn, int type, cw_MsgCallbackFun fun) | ||||
| @ -489,10 +490,7 @@ static int process_elements(struct cw_Conn *conn, uint8_t * rawmsg, int len, | ||||
| 	params.cfg->dbg_level = DBG_ELEM_DETAIL_IN; | ||||
| 	params.cfg->dbg_prefix = "    "; | ||||
|  | ||||
| 	params.cfg_list[0]=params.cfg; | ||||
| 	params.cfg_list[1]=conn->local_cfg; | ||||
| 	params.cfg_list[2]=conn->global_cfg; | ||||
| 	params.cfg_list[3]=NULL; | ||||
| 	params.cfg_list=conn->cfg_list; | ||||
|  | ||||
| 	params.from = from; | ||||
| 	params.msgdata = message; | ||||
| @ -536,7 +534,7 @@ static int process_elements(struct cw_Conn *conn, uint8_t * rawmsg, int len, | ||||
|  | ||||
| 			cw_send_error_response(conn, rawmsg, result_code); | ||||
| 		} else if (result_code == 0) { | ||||
| 			cw_cfg_set_int(conn->update_cfg, "result-code", | ||||
| 			cw_cfg_set_int(conn->update_cfg, "capwap/result-code", | ||||
| 					 result_code); | ||||
| 			if (ui->next) { | ||||
| 				conn->capwap_prevstate = conn->capwap_state; | ||||
|  | ||||
| @ -86,6 +86,8 @@ struct cw_Conn { | ||||
| 				     configuration status request.  */ | ||||
|  | ||||
| 	cw_Cfg_t * update_cfg; | ||||
|  | ||||
| 	cw_Cfg_t * cfg_list[10]; | ||||
| 	 | ||||
| 	bstr16_t session_id; | ||||
|  | ||||
|  | ||||
| @ -118,13 +118,15 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP | ||||
| 	int radios; | ||||
| 	len =0; | ||||
| 	 | ||||
| 	radios = cw_cfg_get_byte_l(params->cfg_list,"wtp-descriptor/max-radios",0); | ||||
| 	radios = cw_cfg_get_byte_l(params->cfg_list,"capwap/wtp-descriptor/max-radios",0); | ||||
| 	for(i=0;i<radios;i++){ | ||||
|  | ||||
| 		type = (struct cw_Type*)handler->type; | ||||
| 		start = params->msgset->header_len(handler)+len; | ||||
|  | ||||
| 		sprintf(key,"radio.%d/%s",i,handler->key); | ||||
| //printf("RADIO KEY: %s\n",key); | ||||
| 		 | ||||
| //		cw_dbg(DBG_X,"KEY: %s",key); | ||||
|  | ||||
| 		l = type->write(params->cfg_list, key,dst+start+1,handler->param); | ||||
|  | ||||
| @ -557,6 +557,8 @@ int cw_put_descriptor_subelem (uint8_t *dst, cw_Cfg_t ** cfg_list, | ||||
|                                  int subelem_id, const char * parent_key ); | ||||
|  | ||||
|  | ||||
| int cw_send_request(struct cw_Conn *conn,int msg_id); | ||||
|  | ||||
| /** | ||||
|  *@} | ||||
|  */ | ||||
|  | ||||
| @ -69,7 +69,7 @@ void cw_discovery_results_add(struct cw_DiscoveryResults *dis, | ||||
| 	} else { | ||||
| 		/* Get priority for AC from  | ||||
| 		 * ac-name-with-priority list */ | ||||
| 		sprintf(key, "ac-name-with-priority/%s", acname); | ||||
| 		sprintf(key, "capwap/ac-name-with-priority/%s", acname); | ||||
| 		e.prio = cw_cfg_get_byte(wtp_cfg, key, 255); | ||||
| 	} | ||||
|  | ||||
| @ -78,7 +78,7 @@ void cw_discovery_results_add(struct cw_DiscoveryResults *dis, | ||||
| 	do { | ||||
| 		const char *ipval; | ||||
|  | ||||
| 		sprintf(key, "capwap-control-ip-address.%d/wtps", i); | ||||
| 		sprintf(key, "capwap/control-ip-address.%d/wtps", i); | ||||
| 		e.wtps = cw_cfg_get_word(ac_cfg, key, 65535); | ||||
|  | ||||
|  | ||||
| @ -86,7 +86,7 @@ void cw_discovery_results_add(struct cw_DiscoveryResults *dis, | ||||
| 		if (e.wtps == 65535) | ||||
| 			break; | ||||
|  | ||||
| 		sprintf(key, "capwap-control-ip-address.%d/address", i); | ||||
| 		sprintf(key, "capwap/control-ip-address.%d/address", i); | ||||
| 		ipval = cw_cfg_get(ac_cfg, key, ""); | ||||
|  | ||||
| 		sprintf(key, "%04d%05d%04d", e.prio, e.wtps, dis->nr); | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| #ifndef __KEYS_H | ||||
| #define __KEYS_H | ||||
|  | ||||
| #define CW_KEY_WTP_DESCRIPTOR "wtp-descriptor" | ||||
| //#define CW_KEY_WTP_DESCRIPTOR "capwap/wtp-descriptor" | ||||
|  | ||||
| #define CW_SKEY_HARDWARE "hardware" | ||||
| #define CW_SKEY_SOFTWARE "software" | ||||
| @ -15,8 +15,8 @@ | ||||
| #define CW_SKEY_RADIOS_IN_USE	"radios-in-use" | ||||
|  | ||||
|  | ||||
| #define CW_KEY_WTP_NAME		"wtp-name" | ||||
| #define CW_KEY_DISCOVERY_TYPE	"discovery-type" | ||||
| //#define CW_KEY_WTP_NAME		"wtp-name" | ||||
| //#define CW_KEY_DISCOVERY_TYPE	"discovery-type" | ||||
| #define CW_KEY_WTP_MAC_TYPE	"wtp-mac-type" | ||||
| #define CW_KEY_WTP_FRAME_TUNNEL_MODE	"wtp-frame-tunnel-mode" | ||||
|  | ||||
|  | ||||
| @ -100,10 +100,7 @@ int cw_compose_message(struct cw_Conn *conn, uint8_t * rawout) | ||||
| //cw_dbg(DBG_X,"setting with update CFG"); | ||||
| 	params.conn=conn; | ||||
| 	params.rawmsg = rawout; | ||||
| 	params.cfg_list[0]=conn->update_cfg; | ||||
| 	params.cfg_list[1]=conn->local_cfg; | ||||
| 	params.cfg_list[2]=conn->global_cfg; | ||||
| 	params.cfg_list[3]=NULL; | ||||
| 	params.cfg_list=conn->cfg_list; | ||||
| 	params.msgset=conn->msgset; | ||||
| 	params.msgdata=msg; | ||||
| 	params.debug_details=details; | ||||
|  | ||||
| @ -36,7 +36,7 @@ struct cw_ElemHandlerParams { | ||||
| 	char * debug_details; | ||||
| 	uint32_t dbg_level; | ||||
| 	cw_Cfg_t * cfg; | ||||
| 	cw_Cfg_t * cfg_list[10]; | ||||
| 	cw_Cfg_t ** cfg_list; | ||||
| 	int len; | ||||
| }; | ||||
|  | ||||
|  | ||||
| @ -102,7 +102,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,1,					/* min/max length */ | ||||
| 		CW_TYPE_BYTE,				/* type */ | ||||
| 		"discovery-type",			/* Key */ | ||||
| 		"capwap/discovery-type",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -117,7 +117,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,1,					/* min/max length */ | ||||
| 		CW_TYPE_BYTE,				/* type */ | ||||
| 		"wtp-mac-type",				/* Key */ | ||||
| 		"capwap/wtp-mac-type",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -131,18 +131,18 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		14,1024,				/* min/max length */ | ||||
| 		NULL,					/* type */ | ||||
| 		CW_KEY_WTP_BOARD_DATA,			/* Key */ | ||||
| 		"capwap/wtp-board-data",			/* Key */ | ||||
| 		capwap_in_wtp_board_data,		/* get */ | ||||
| 		capwap_out_wtp_board_data		/* put */ | ||||
| 	} | ||||
| 	, | ||||
| 	{  | ||||
| 		"WTP Descriptor",			/* name */ | ||||
| 		CAPWAP_ELEM_WTP_DESCRIPTOR,		/* Element ID */ | ||||
| 		CAPWAP_ELEM_WTP_DESCRIPTOR,		/* #Element ID */ | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		33,1024,				/* min/max length */ | ||||
| 		NULL,					/* type */ | ||||
| 		CW_KEY_WTP_DESCRIPTOR,			/* Key */ | ||||
| 		"capwap/wtp-descriptor",		/* Key */ | ||||
| 		capwap_in_wtp_descriptor,		/* get */ | ||||
| 		capwap_out_wtp_descriptor,		/* put */ | ||||
| 	} | ||||
| @ -153,7 +153,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,1,					/* min/max length */ | ||||
| 		CW_TYPE_BYTE,				/* type */ | ||||
| 		CW_KEY_WTP_FRAME_TUNNEL_MODE,		/* Key */ | ||||
| 		"capwap/wtp-frame-tunnel-mode",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -193,7 +193,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		0,0,					/* min/max length */ | ||||
| 		NULL,					/* type */ | ||||
| 		CW_KEY_AC_DESCRIPTOR,			/* Key */ | ||||
| 		"capwap/ac-descriptor",			/* Key */ | ||||
| 		capwap_in_ac_descriptor,		/* get */ | ||||
| 		capwap_out_ac_descriptor		/* put */ | ||||
| 	} | ||||
| @ -205,7 +205,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,CAPWAP_MAX_AC_NAME_LEN,		/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"ac-name",				/* Key */ | ||||
| 		"capwap/ac-name",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -217,7 +217,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		6,6,					/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"capwap-control-ip-address",		/* Key */ | ||||
| 		"capwap/control-ip-address",		/* Key */ | ||||
| 		capwap_in_capwap_control_ip_address,	/* get */ | ||||
| 		capwap_out_capwap_control_ip_address	/* put */ | ||||
| 	}, | ||||
| @ -228,7 +228,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		18,18,					/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"capwap-control-ip-address",		/* Key */ | ||||
| 		"capwap/control-ip-address",		/* Key */ | ||||
| 		capwap_in_capwap_control_ip_address,	/* get */ | ||||
| 		capwap_out_capwap_control_ip_address	/* put */ | ||||
| 	} | ||||
| @ -241,7 +241,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,CAPWAP_MAX_LOCATION_DATA_LEN,		/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"location-data",			/* Key */ | ||||
| 		"capwap/location-data",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -253,7 +253,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,CAPWAP_MAX_WTP_NAME_LEN,		/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"wtp-name",				/* Key */ | ||||
| 		"capwap/wtp-name",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -264,7 +264,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		CAPWAP_SESSION_ID_LEN,CAPWAP_SESSION_ID_LEN,	/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"session-id",				/* Key */ | ||||
| 		"capwap/session-id",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -276,7 +276,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		4,4,					/* min/max length */ | ||||
| 		CW_TYPE_DWORD,				/* type */ | ||||
| 		"result-code",				/* Key */ | ||||
| 		"capwap/result-code",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -288,7 +288,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,1,					/* min/max length */ | ||||
| 		CW_TYPE_BYTE,				/* type */ | ||||
| 		"ecn-support",				/* Key */ | ||||
| 		"capwap/ecn-support",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -300,7 +300,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		2,2,					/* min/max length */ | ||||
| 		CW_TYPE_WORD,				/* type */ | ||||
| 		"maximum-message-length",		/* Key */ | ||||
| 		"capwap/maximum-message-length",	/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -312,7 +312,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		4,4,					/* min/max length */ | ||||
| 		CW_TYPE_IPADDRESS,			/* type */ | ||||
| 		"capwap-local-ip-address",		/* Key */ | ||||
| 		"capwap/local-ip-address",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		capwap_out_capwap_local_ip_address	/* put */ | ||||
| 	} | ||||
| @ -323,7 +323,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		16,16,					/* min/max length */ | ||||
| 		CW_TYPE_IPADDRESS,			/* type */ | ||||
| 		"capwap-local-ip-address",		/* Key */ | ||||
| 		"capwap/local-ip-address",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		capwap_out_capwap_local_ip_address	/* put */ | ||||
| 	} | ||||
| @ -336,7 +336,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		2,2,					/* min/max length */ | ||||
| 		CW_TYPE_WORD,				/* type */ | ||||
| 		"statistics-timer",			/* Key */ | ||||
| 		"capwap/statistics-timer",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -348,7 +348,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		15,15,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"wtp-reboot-statistics",		/* Key */ | ||||
| 		"capwap/wtp-reboot-statistics",		/* Key */ | ||||
| 		cw_in_generic,				/* handler */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -364,7 +364,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		2, 2,						/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,					/* type */ | ||||
| 		"admin-state",					/* Key */ | ||||
| 		"capwap/admin-state",				/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -380,7 +380,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,					/* Vendor / Proto */ | ||||
| 		2, 2,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"capwap-timers",			/* Key */ | ||||
| 		"capwap/timers",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -395,7 +395,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		3, 3,						/* min/max length */ | ||||
| 		CW_TYPE_WORD,					/* type */ | ||||
| 		"decryption-error-report-period",		/* Key */ | ||||
| 		"capwap/decryption-error-report-period",	/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic				/* put */ | ||||
| 	} | ||||
| @ -407,7 +407,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		4, 4,						/* min/max length */ | ||||
| 		CW_TYPE_DWORD,					/* type */ | ||||
| 		"idle-timeout",					/* Key */ | ||||
| 		"capwap/idle-timeout",				/* Key */ | ||||
| 		cw_in_generic,					/* get */ | ||||
| 		cw_out_generic					/* put */ | ||||
| 	} | ||||
| @ -419,7 +419,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		1, 1,						/* min/max length */ | ||||
| 		CW_TYPE_BYTE,					/* type */ | ||||
| 		"wtp-fallback",					/* Key */ | ||||
| 		"capwap/wtp-fallback",				/* Key */ | ||||
| 		cw_in_generic,					/* get */ | ||||
| 		cw_out_generic					/* put */ | ||||
| 	} | ||||
| @ -430,7 +430,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		3, 3,						/* min/max length */ | ||||
| 		radio_operational_state,			/* type */ | ||||
| 		"operational-state",				/* Key */ | ||||
| 		"capwap/operational-state",			/* Key */ | ||||
| 		cw_in_radio_generic_struct,			/* get */ | ||||
| 		cw_out_radio_generic_struct			/* put */ | ||||
| 	} | ||||
| @ -442,7 +442,7 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		1,513,					/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"ac-name-with-index",			/* Key */ | ||||
| 		"capwap/ac-name-with-priority",		/* Key */ | ||||
| 		cw_in_generic_with_index,		/* get */ | ||||
| 		cw_out_generic_with_index		/* put */ | ||||
| 	} | ||||
|  | ||||
| @ -31,7 +31,7 @@ | ||||
|  | ||||
|  | ||||
| static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem, | ||||
| 					int len) | ||||
| 					int len,const char *pkey) | ||||
| { | ||||
| 	int i = 0; | ||||
| 	uint32_t val; | ||||
| @ -56,11 +56,7 @@ static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem, | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| /*		cw_dbg(DBG_SUBELEM, "WTP board data sub-element, type=%d, len=%d", | ||||
| 		       subtype, sublen);*/ | ||||
|  | ||||
| 		switch (subtype) { | ||||
|  | ||||
| 			 | ||||
| 			case CW_BOARDDATA_MODELNO: | ||||
| 				key = "model-no"; | ||||
| @ -83,7 +79,7 @@ static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem, | ||||
| 		} | ||||
| 		if (key != NULL){ | ||||
| 			char add_key[CW_CFG_MAX_KEY_LEN]; | ||||
| 			sprintf(add_key,"wtp-board-data/%s",key); | ||||
| 			sprintf(add_key,"%s/%s",pkey,key); | ||||
| 			cw_cfg_set_val(cfg,add_key,CW_TYPE_BSTR16,NULL,msgelem+i,sublen); | ||||
| 			 | ||||
| 		} | ||||
| @ -107,7 +103,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar | ||||
| 	sprintf(vendor_key,"%s/%s",eh->key,"vendor"); | ||||
| 	cw_cfg_set_val(params->cfg,vendor_key,CW_TYPE_DWORD,NULL,data,len); | ||||
|  | ||||
| 	readsubelems_wtp_board_data(params->cfg, data + 4, len - 4); | ||||
| 	readsubelems_wtp_board_data(params->cfg, data + 4, len - 4,eh->key); | ||||
| 	return 1; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -15,14 +15,27 @@ | ||||
| 			uint8_t * data,	 int len); | ||||
| */ | ||||
|  | ||||
|  | ||||
| char x[] = {'a','b'}; | ||||
|  | ||||
| static cw_ValStruct_t capwap80211_antenna_stru[]={ | ||||
| 	{CW_TYPE_BOOL,"diversity",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"combiner",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"antenna-count",1,-1}, | ||||
| 	{NULL,"xxx",1,-1,x}, | ||||
| //	{NULL,"xxx",1,-1,"a",} | ||||
| 	{NULL,NULL,0,0} | ||||
| }; | ||||
|  | ||||
|  | ||||
| static struct cw_ElemHandler handlers[] = { | ||||
| 	{ | ||||
| 		"IEEE 802.11 WTP Radio Information",			/* name */ | ||||
| 		"IEEE 802.11 WTP Radio Information",		/* name */ | ||||
| 		CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,		/* Element ID */ | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		0, 0,						/* min/max length */ | ||||
| 		CW_TYPE_DWORD,					/* type */ | ||||
| 		"wtp-radio-information",			/* Key */ | ||||
| 		"capwap80211/wtp-radio-information",		/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic				/* put */ | ||||
| 	} | ||||
| @ -33,39 +46,55 @@ static struct cw_ElemHandler handlers[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		3, 0,						/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,					/* type */ | ||||
| 		"rate_set",					/* Key */ | ||||
| 		"capwap80211/rate-set",				/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic				/* put */ | ||||
| 	} | ||||
| 	, | ||||
| 	{NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL} | ||||
| 	{ | ||||
| 		"IEEE 802.11 Antenna",				/* name */ | ||||
| 		CAPWAP80211_ELEM_ANTENNA,				/* Element ID */ | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		3, 0,						/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,					/* type */ | ||||
| 		"capwap80211/antenna",				/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic,				/* put */ | ||||
| 		NULL, | ||||
| 		NULL, | ||||
| 		capwap80211_antenna_stru | ||||
|  | ||||
| 	} | ||||
| 	, | ||||
| 	{NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL} | ||||
|  | ||||
| }; | ||||
|  | ||||
| /*static int discovery_request_states[] = { CAPWAP_STATE_DISCOVERY, 0 };*/ | ||||
| static struct cw_ElemDef discovery_request_elements[] = { | ||||
| 	{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, | ||||
| 	{0, 0, 0, 0, 0} | ||||
|  | ||||
| }; | ||||
|  | ||||
| static struct cw_ElemDef discovery_response_elements[] = { | ||||
| 	{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, | ||||
| 	{0, 0, 0, 0, 0} | ||||
|  | ||||
| }; | ||||
|  | ||||
|  | ||||
| /*static int join_request_states[] = { CAPWAP_STATE_JOIN, 0 };*/ | ||||
| static struct cw_ElemDef join_request_elements[] = { | ||||
| 	{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, | ||||
| 	{0, 0, 0, 0, 0} | ||||
|  | ||||
| }; | ||||
|  | ||||
| /*static int join_response_states[] = { CAPWAP_STATE_JOIN, 0 };*/ | ||||
| static struct cw_ElemDef join_response_elements[] = { | ||||
| 	{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,	1, 0}, | ||||
| 	{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, | ||||
| 	{0, 0, 0, 0, 0} | ||||
|  | ||||
| }; | ||||
|  | ||||
| /*static int configuration_status_response_states[] = { CAPWAP_STATE_JOIN, 0 };*/ | ||||
| static struct cw_ElemDef configuration_status_response_elements[] = { | ||||
| 	{0, 0, CAPWAP80211_ELEM_RATE_SET		, 1, 0}, | ||||
| 	{0, 0, 0, 0, 0} | ||||
| @ -80,6 +109,14 @@ static struct cw_MsgDef messages[] = { | ||||
| 		discovery_request_elements | ||||
| 	} | ||||
| 	, | ||||
| 	{ | ||||
| 		NULL, | ||||
| 		CAPWAP_MSG_DISCOVERY_RESPONSE, | ||||
| 		CW_ROLE_WTP, | ||||
| 		NULL,				/* states */ | ||||
| 		discovery_response_elements | ||||
| 	} | ||||
| 	, | ||||
| 	{ | ||||
| 		NULL,				/* name */ | ||||
| 		CAPWAP_MSG_JOIN_REQUEST,	/* type */ | ||||
|  | ||||
| @ -1,117 +0,0 @@ | ||||
|  | ||||
| #include "cw/mbag.h" | ||||
| #include "cw/action.h" | ||||
| #include "cw/dbg.h" | ||||
| #include "cw/cw.h" | ||||
|  | ||||
| #include "cisco_items.h" | ||||
| #include "include/cipwap_items.h" | ||||
| #include "cw/capwap80211_items.h" | ||||
|  | ||||
| //int mbag_get_upd(mbag_t b, mbag_t b_upd, const char *id, | ||||
| //		 uint8_t * dst, struct mbag_typedef * deftype, uint8_t * def, int deflen); | ||||
|  | ||||
|  | ||||
| int mbag_get_upd(mbag_t b, mbag_t b_upd, const char *id, uint8_t *dst, int *found); | ||||
|  | ||||
| int cisco80211_out_wtp_radio_configuration(struct conn *conn, struct cw_action_out *a, uint8_t * dst) | ||||
| { | ||||
|  | ||||
| cw_dbg(DBG_X,"The update beginns ***************************************************************"); | ||||
| 	int count=0; | ||||
| 	int n; | ||||
| 	uint8_t *d = dst+10; | ||||
|  | ||||
| 	MAVLITER_DEFINE(it,conn->radios_upd); | ||||
| 	mavliter_foreach(&it){ | ||||
| 		struct mbag_item *r = mavliter_get(&it); | ||||
| 		mbag_t radio_upd = r->u2.data; | ||||
| 		mbag_t radio = mbag_i_get_mbag(conn->radios,r->u1.iid,NULL); | ||||
|  | ||||
| 		radio = radio_upd; | ||||
|  | ||||
| 		d+=cw_put_byte(d,r->u1.iid); | ||||
|  | ||||
| //		mbag_t radio = mbag_i_get(conn->radios,radio_upd->data->iid); | ||||
|  | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CISCO_RADIOITEM80211_CFG_TYPE,d,&count); | ||||
| 		d += n==-1 ? cw_put_byte(dst,0) : n; | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT,d,&count); | ||||
| 		d += n==-1 ? cw_put_word(dst,100) : n; | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CIPWAP_RADIOITEM80211_CFP_PERIOD,d,&count); | ||||
| 		d += n==-1 ? cw_put_byte(dst,4) : n; | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION,d,&count); | ||||
| 		d += n==-1 ? cw_put_word(dst,60) : n; | ||||
| 		 | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CW_RADIOITEM80211_BSSID,d,&count); | ||||
| 		if (n==-1){ | ||||
| 			char defbssid[6]={1,2,3,4,5,6}; | ||||
| 			memcpy(d,defbssid,6); | ||||
| 			d+=6; | ||||
| 		} | ||||
| 		else | ||||
| 			d+=n; | ||||
|  | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CW_RADIOITEM80211_BEACON_PERIOD,d,&count); | ||||
| 		d += n==-1 ? cw_put_word(dst,100) : n; | ||||
|  | ||||
|  | ||||
|  | ||||
| 		int dcount = 0; | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CISCO_RADIOITEM80211_COUNTRY_STR1,d,&dcount); | ||||
| 		if (!dcount){ | ||||
| 			n  = mbag_get_upd(radio,radio_upd,CW_RADIOITEM80211_COUNTRY_STRING,d,&count); | ||||
| 			d += n==-1 ? cw_put_data(d,(uint8_t*)"DE ",3) : n; | ||||
| 		} | ||||
| 		else | ||||
| 			d+=n; | ||||
|  | ||||
| 		dcount=0; | ||||
| 		n  = mbag_get_upd(radio,radio_upd,CISCO_RADIOITEM80211_COUNTRY_STR2,d,&dcount); | ||||
| 		if (!dcount){ | ||||
| 			n  = mbag_get_upd(radio,radio_upd,CW_RADIOITEM80211_COUNTRY_STRING,d,&count); | ||||
| 			d += n==-1 ? cw_put_data(d,(uint8_t*)"DE ",3) : n; | ||||
| 		} | ||||
| 		else | ||||
| 			d+=n; | ||||
|  | ||||
| 		count +=dcount; | ||||
|  | ||||
|  | ||||
| 		d+=cw_put_byte(d,10); | ||||
| 		d+=cw_put_word(d,1); | ||||
| 		d+=cw_put_word(d,0); | ||||
| 		d+=cw_put_word(d,177<<8); | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	if (!count){ | ||||
| 		cw_dbg(DBG_X,"Return 0, because no item was in radio"); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	cw_dbg(DBG_X,"Yupp we do!"); | ||||
| 	int l = d-dst-10; | ||||
| 	return l + cw_put_elem_vendor_hdr(dst, a->vendor_id, a->elem_id, l); | ||||
|  | ||||
|  | ||||
| 	/* | ||||
|  | ||||
|  | ||||
| 	mbag_set_word(r,CW_RADIOITEM80211_BEACON_PERIOD,cw_get_word(data+13)); | ||||
| 	mbag_set_bstr16n(r,CW_RADIOITEM80211_COUNTRY_STRING,data+15,3); | ||||
| 	mbag_set_bstr16n(r,CISCO_RADIOITEM80211_COUNTRY_STR1,data+15,3); | ||||
| 	mbag_set_bstr16n(r,CISCO_RADIOITEM80211_COUNTRY_STR2,data+18,3); | ||||
|  | ||||
| */ | ||||
|  | ||||
| //	mbag_set_byte(r,CISCO_RADIOITEM80211_CFG_TYPE,cw_get_byte(data+1)); | ||||
| 		 | ||||
| 	 | ||||
|  | ||||
|  | ||||
| } | ||||
| @ -34,6 +34,10 @@ static int postprocess_discovery(); | ||||
| static int preprocess_join_request(); | ||||
| static int postprocess_join_request(); | ||||
|  | ||||
| int cisco_out_radio_info(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params | ||||
| 			, uint8_t * dst); | ||||
|  | ||||
|  | ||||
| static cw_ValValRange_t cfg_type[]={ | ||||
| 	{1,1,"1 - global"}, | ||||
| 	{2,2,"2 - custom"}, | ||||
| @ -297,7 +301,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh, | ||||
| 	 | ||||
|  | ||||
| 	type = NULL; | ||||
| 	result = cw_cfg_get_val_l(params->cfg_list,"wtp-descriptor/software/version",CW_TYPE_BSTR16); | ||||
| 	result = cw_cfg_get_val_l(params->cfg_list,"capwap/wtp-descriptor/software/version",CW_TYPE_BSTR16); | ||||
| 	if (result!=NULL){ | ||||
| 		if(result->type->len(result)==4){ | ||||
| 			uint32_t rv; | ||||
| @ -371,9 +375,10 @@ static cw_ValStruct_t cisco_antenna_payload70[]={ | ||||
| 	{CW_TYPE_BYTE,"diversity-selection",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"antenna-mode",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"number-of-antennas",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"unknown",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"802-11n-tx-antennas",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"802-11n-rx-antennas",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"unknown",1,-1}, | ||||
| //	{CW_TYPE_BYTE,"unknown",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"antenna-1",1,-1}, | ||||
| 	{CW_TYPE_BYTE,"antenna-2",1,-1}, | ||||
| 	{NULL,NULL,0,0} | ||||
| @ -432,7 +437,7 @@ static cw_ValStruct_t cisco_wtp_radio_config75[]={ | ||||
|  | ||||
|  | ||||
| static cw_ValStruct_t cisco_tx_power[]={ | ||||
| 	{CW_TYPE_BYTE,"cfg-type",1,-1,cfg_type}, | ||||
| 	{CW_TYPE_BYTE,"@cisco/cfg-type",1,-1,cfg_type}, | ||||
| 	{CW_TYPE_WORD,"current-tx-power",2,-1}, | ||||
| 	{NULL,NULL,0,0} | ||||
| }; | ||||
| @ -810,7 +815,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,				/* Vendor / Proto */ | ||||
| 		4,128,				/* min/max length */ | ||||
| 		NULL,				/* type */ | ||||
| 		CW_KEY_WTP_DESCRIPTOR,		/* Key */ | ||||
| 		"capwap/wtp-descriptor",	/* Key */ | ||||
| 		cisco_in_wtp_descriptor, 	/* get */ | ||||
| 		cisco_out_wtp_descriptor	/* put */ | ||||
| 	} | ||||
| @ -821,7 +826,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,				/* Vendor / Proto */ | ||||
| 		4,128,				/* min/max length */ | ||||
| 		NULL,				/* type */ | ||||
| 		"ac-descriptor",		/* Key */ | ||||
| 		"capwap/ac-descriptor",		/* Key */ | ||||
| 		cisco_in_ac_descriptor, 	/* get */ | ||||
| 		cisco_out_ac_descriptor		/* put */ | ||||
| 	} | ||||
| @ -832,7 +837,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO,0,		/* Vendor / Proto */ | ||||
| 		1,512,				/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,			/* type */ | ||||
| 		CW_KEY_WTP_NAME,		/* Key */ | ||||
| 		"capwap/wtp-name",		/* Key */ | ||||
| 		cw_in_generic,			/* get */ | ||||
| 		cw_out_generic			/* put */ | ||||
| 	} | ||||
| @ -884,9 +889,9 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0, 0,						/* Vendor / Proto */ | ||||
| 		0, 0,						/* min/max length */ | ||||
| 		CW_TYPE_DWORD,					/* type */ | ||||
| 		"wtp-radio-information",			/* Key */ | ||||
| 		"capwap80211/wtp-radio-information",		/* Key */ | ||||
| 		cw_in_radio_generic,				/* get */ | ||||
| 		cw_out_radio_generic				/* put */ | ||||
| 		cisco_out_radio_info				/* put */  | ||||
| 	} | ||||
| 	, | ||||
| 	{  | ||||
| @ -895,7 +900,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		4,CAPWAP_SESSION_ID_LEN,		/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"session-id",				/* Key */ | ||||
| 		"capwap/session-id",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -920,8 +925,8 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		7,7,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"cisco/mwar-addr",			/* Key */ | ||||
| 		cw_in_generic,			/* get */ | ||||
| 		cw_out_generic,			/* put */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| 		NULL, | ||||
| 		mwar_addr | ||||
| @ -933,7 +938,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		4,4,					/* min/max length */ | ||||
| 		CW_TYPE_IPADDRESS,			/* type */ | ||||
| 		"capwap-local-ip-address",		/* Key */ | ||||
| 		"capwap/local-ip-address",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cisco_out_capwap_local_ip_address	/* put */ | ||||
| 	} | ||||
| @ -945,7 +950,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		16,16,					/* min/max length */ | ||||
| 		CW_TYPE_IPADDRESS,			/* type */ | ||||
| 		"capwap-local-ip-address",		/* Key */ | ||||
| 		"capwap/local-ip-address",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cisco_out_capwap_local_ip_address	/* put */ | ||||
| 	} | ||||
| @ -1357,7 +1362,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO,0,			/* Vendor / Proto */ | ||||
| 		4,4,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"cisco/tx-power",			/* Key */ | ||||
| 		"capwap80211/tx-power",			/* Key */ | ||||
| 		cw_in_radio_generic,			/* get */ | ||||
| 		cw_out_radio_generic,			/* put */ | ||||
| 		NULL, | ||||
| @ -1781,7 +1786,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO,0,			/* Vendor / Proto */ | ||||
| 		0,1024,					/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"location-data",			/* Key */ | ||||
| 		"capwap/location-data",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	}, | ||||
| @ -1807,7 +1812,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO,0,			/* Vendor / Proto */ | ||||
| 		2,2,					/* min/max length */ | ||||
| 		CW_TYPE_WORD,				/* type */ | ||||
| 		"statistics-timer",			/* Key */ | ||||
| 		"capwap/statistics-timer",		/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic				/* put */ | ||||
| 	} | ||||
| @ -1819,7 +1824,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO,0,			/* Vendor / Proto */ | ||||
| 		1,513,					/* min/max length */ | ||||
| 		CW_TYPE_BSTR16,				/* type */ | ||||
| 		"ac-name-with-index",			/* Key */ | ||||
| 		"capwap/ac-name-with-priority",		/* Key */ | ||||
| 		cw_in_generic_with_index,		/* get */ | ||||
| 		cw_out_generic_with_index		/* put */ | ||||
| 	} | ||||
| @ -1938,12 +1943,12 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 	, | ||||
|  | ||||
| 	{  | ||||
| 		"SSC Hash",					/* name */ | ||||
| 		"SSC Hash",				/* name */ | ||||
| 		CISCO_LWELEM_SSC_HASH,			/* Element ID */ | ||||
| 		CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP,	/* Vendor / Proto */ | ||||
| 		1,331,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"cisco/hash",				/* Key */ | ||||
| 		"cisco/ssc-hash",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -1971,7 +1976,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		0,0,					/* Vendor / Proto */ | ||||
| 		3,3,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"operational-state",			/* Key */ | ||||
| 		"capwap/operational-state",		/* Key */ | ||||
| 		cw_in_radio_generic,			/* get */ | ||||
| 		cw_out_radio_generic,			/* put */ | ||||
| 		NULL,					/* mkkey */ | ||||
| @ -2029,7 +2034,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO, 0,			/* Vendor / Proto */ | ||||
| 		2, 2,					/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"capwap-timers",			/* Key */ | ||||
| 		"capwap/timers",			/* Key */ | ||||
| 		cw_in_generic,				/* get */ | ||||
| 		cw_out_generic,				/* put */ | ||||
| 		NULL, | ||||
| @ -2044,7 +2049,7 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| 		CW_VENDOR_ID_CISCO, 0,						/* Vendor / Proto */ | ||||
| 		4, 4,						/* min/max length */ | ||||
| 		CW_TYPE_STRUCT,				/* type */ | ||||
| 		"cisco-8011-assoc-limit",			/* Key */ | ||||
| 		"cisco/8011-assoc-limit",			/* Key */ | ||||
| 		cw_in_generic,					/* get */ | ||||
| 		cw_out_generic,					/* put */ | ||||
| 		NULL, | ||||
| @ -2122,13 +2127,12 @@ static struct cw_ElemHandler handlers70[] = { | ||||
| }; | ||||
|  | ||||
|  | ||||
| /*static uint16_t discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};*/ | ||||
| static struct cw_ElemDef discovery_request_elements[] ={ | ||||
| /*	{0,0,			CAPWAP_ELEM_WTP_DESCRIPTOR,	1, 0},*/ | ||||
| 	{0,0,			CAPWAP_ELEM_WTP_BOARD_DATA,	0, 0}, | ||||
| 	{0,CW_VENDOR_ID_CISCO,	CISCO_ELEM_RAD_NAME,		1, 0}, | ||||
| 	{0,CW_VENDOR_ID_CISCO,	CW_CISCO_BOARD_DATA_OPTIONS,	0, 0}, | ||||
| 	{0,0,			CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,	0, 0}, | ||||
| 	{0,0,			CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,	1, 0}, | ||||
| 	{0,0,0,00} | ||||
| 	 | ||||
| }; | ||||
| @ -2137,7 +2141,7 @@ static struct cw_ElemDef discovery_request_elements[] ={ | ||||
| static struct cw_ElemDef discovery_response_elements[] ={ | ||||
| 	{0,CW_VENDOR_ID_CISCO,	CISCO_ELEM_AP_TIMESYNC,			1, 0}, | ||||
| 	{0,CW_VENDOR_ID_CISCO,	CISCO_ELEM_MWAR_TYPE,			0, 0}, | ||||
| 	{0,0,			CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,	0, 0}, | ||||
| 	{0,0,			CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,	1, 0}, | ||||
| 	{0,0,0,00} | ||||
| 	 | ||||
| }; | ||||
| @ -2758,15 +2762,15 @@ static void set_ac_version(struct cw_ElemHandlerParams * params) | ||||
| { | ||||
| 	bstr16_t wtpver; | ||||
| 	char verstr[512]; | ||||
| 	wtpver = cw_cfg_get_bstr16(params->cfg,"wtp-descriptor/software/version",NULL); | ||||
| 	wtpver = cw_cfg_get_bstr16(params->cfg,"capwap/wtp-descriptor/software/version",NULL); | ||||
| 	if (wtpver==NULL) | ||||
| 		return; | ||||
|  | ||||
| 	cw_format_version(verstr,bstr16_data(wtpver),bstr16_len(wtpver)); | ||||
| 	cw_dbg(DBG_INFO, "Cisco - Setting AC software version to: %s", verstr); | ||||
| 	 | ||||
| 	cw_cfg_set_bstr16(params->conn->local_cfg,"ac-descriptor/software/version",wtpver); | ||||
| 	cw_cfg_set_int(params->conn->local_cfg,"ac-descriptor/software/vendor",CW_VENDOR_ID_CISCO); | ||||
| 	cw_cfg_set_bstr16(params->conn->local_cfg,"capwap/ac-descriptor/software/version",wtpver); | ||||
| 	cw_cfg_set_int(params->conn->local_cfg,"capwap/ac-descriptor/software/vendor",CW_VENDOR_ID_CISCO); | ||||
|  | ||||
| 	if(bstr16_len(wtpver)==4){ | ||||
| 		uint32_t rv; | ||||
| @ -2814,9 +2818,9 @@ static int preprocess_join_request(struct cw_Conn *conn) | ||||
|  | ||||
| 	use_ac_version = cw_cfg_get_bool(conn->global_cfg,"cisco/wtp-use-ac-version",0); | ||||
| 	if (use_ac_version){ | ||||
| 		ver = cw_cfg_get_bstr16(conn->remote_cfg,"ac-descriptor/software/version",NULL ); | ||||
| 		ver = cw_cfg_get_bstr16(conn->remote_cfg,"capwap/ac-descriptor/software/version",NULL ); | ||||
| 		if (ver != NULL){ | ||||
| 			cw_cfg_set_bstr16(conn->local_cfg,"wtp-descriptor/software/version",ver); | ||||
| 			cw_cfg_set_bstr16(conn->local_cfg,"capwap/wtp-descriptor/software/version",ver); | ||||
| 			cw_format_version(verstr,bstr16_data(ver),bstr16_len(ver)); | ||||
| 			cw_dbg(DBG_INFO, "Cisco WTP - Using AC's software version: %s", verstr); | ||||
| 			free(ver); | ||||
|  | ||||
| @ -25,3 +25,20 @@ cw_dbg(DBG_X,"NUM RADIOS: %d",radios); | ||||
| 	return len; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| int cisco_out_radio_info(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params | ||||
| 			, uint8_t * dst) | ||||
| { | ||||
| 	if (! (params->msgdata->type & 1) ){ | ||||
| 		int start = params->msgset->header_len(handler); | ||||
| 		cw_put_byte(dst+start,0); | ||||
| 		cw_put_dword(dst+start+1,7); | ||||
| 		return params->msgset->write_header(handler,dst,5); | ||||
| 	} | ||||
| 	return cw_out_radio_generic(handler,params,dst);	 | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -232,7 +232,7 @@ int static setup_cfg(struct cw_Conn  * conn) | ||||
| 	security = cw_setup_dtls(conn,conn->global_cfg,"cisco",CAPWAP_CIPHER); | ||||
|  | ||||
| 	if (conn->role == CW_ROLE_AC){ | ||||
| 		cw_cfg_set_int(conn->local_cfg,"ac-descriptor/security",security); | ||||
| 		cw_cfg_set_int(conn->local_cfg,"capwap/ac-descriptor/security",security); | ||||
| 	 | ||||
| //		if (conn->default_cfg==NULL){ | ||||
| //			conn->default_cfg=cw_cfg_create(); | ||||
|  | ||||
| @ -2,23 +2,45 @@ | ||||
| # This file is igenerated  by WAT | ||||
| # If you edit this, your cahnges might be overwritten | ||||
| # | ||||
| ac-name-with-index.0:  | ||||
| ac-name-with-index.1:  | ||||
| ac-name-with-index.2:  | ||||
| capwap-local-ip-address: 192.168.0.13 | ||||
| capwap-timers/echo-interval: 0 | ||||
| capwap-timers/max-discovery-interval: 0 | ||||
| capwap/ac-name:  | ||||
| cisco-8011-assoc-limit/enable: false | ||||
| cisco-8011-assoc-limit/interval: 500 | ||||
| cisco-8011-assoc-limit/limit: 25 | ||||
| cisco/ac-ip-addr-with-index.0: 0.0.0.0 | ||||
| cisco/ac-ip-addr-with-index.1: 0.0.0.0 | ||||
| cisco/ac-ip-addr-with-index.2: 0.0.0.0 | ||||
| capwap/idle-timeout: 300 | ||||
| capwap/local-ip-address: 192.168.0.24 | ||||
| capwap/location-data: default location | ||||
| capwap/maximum-message-length: 14000 | ||||
| capwap/session-id: .x14c4c46b | ||||
| capwap/statistics-timer: 180 | ||||
| capwap/timers/echo-interval: 30 | ||||
| capwap/timers/max-discovery-interval: 10 | ||||
| capwap/wtp-board-data/board-id: .x0000 | ||||
| capwap/wtp-board-data/mac-address: .x0800276edf58 | ||||
| capwap/wtp-board-data/model-no: "AIR-LAP1142N-E-K9   " | ||||
| capwap/wtp-board-data/revision: A0 | ||||
| capwap/wtp-board-data/serial-no: FCZ1406W232 | ||||
| capwap/wtp-board-data/vendor: 4232704 | ||||
| capwap/wtp-descriptor/bootloader/vendor: 4232704 | ||||
| capwap/wtp-descriptor/bootloader/version: .x0c041200 | ||||
| capwap/wtp-descriptor/hardware/vendor: 4232704 | ||||
| capwap/wtp-descriptor/hardware/version: .x01000000 | ||||
| capwap/wtp-descriptor/max-radios: 2 | ||||
| capwap/wtp-descriptor/radios-in-use: 2 | ||||
| capwap/wtp-descriptor/software/vendor: 4232704 | ||||
| capwap/wtp-descriptor/software/version: .x07007400 | ||||
| capwap/wtp-fallback: 1 | ||||
| capwap/wtp-frame-tunnel-mode: 4 | ||||
| capwap/wtp-mac-type: 1 - Split MAC | ||||
| capwap/wtp-name: Soft-WTP | ||||
| capwap/wtp-reboot-statistics/ac-initiated-count: 113 | ||||
| capwap/wtp-reboot-statistics/hw-failure-count: 0 | ||||
| capwap/wtp-reboot-statistics/last-failure-type: 1 | ||||
| capwap/wtp-reboot-statistics/link-failure-count: 0 | ||||
| capwap/wtp-reboot-statistics/other-failure-count: 1 | ||||
| capwap/wtp-reboot-statistics/reboot-count: 0 | ||||
| capwap/wtp-reboot-statistics/sw-failure-count: 0 | ||||
| capwap/wtp-reboot-statistics/unknown-failure-count: 0 | ||||
| cisco/8011-assoc-limit/enable: false | ||||
| cisco/8011-assoc-limit/interval: 500 | ||||
| cisco/8011-assoc-limit/limit: 25 | ||||
| cisco/ap-backup-software-version: .x00000000 | ||||
| cisco/ap-core-dump/compression: false | ||||
| cisco/ap-core-dump/filename:  | ||||
| cisco/ap-core-dump/tftp-server: 0.0.0.0 | ||||
| cisco/ap-dtls-data-cfg/cabable: true | ||||
| cisco/ap-dtls-data-cfg/enabled: false | ||||
| cisco/ap-ethernet-port-type: .x000000 | ||||
| @ -31,7 +53,7 @@ cisco/ap-mode-and-type/type: 15 | ||||
| cisco/ap-model/image: 12.4(23c)JA2 | ||||
| cisco/ap-model/model: "AIR-LAP1142N-E-K9   " | ||||
| cisco/ap-power-injector-config/selection: 0 | ||||
| cisco/ap-power-injector-config/state: 34 | ||||
| cisco/ap-power-injector-config/state: 17 | ||||
| cisco/ap-power-injector-config/switch-mac-address: .x000000000000 | ||||
| cisco/ap-pre-std-switch-config: 0 | ||||
| cisco/ap-regulatory-domain.0/code0: 0 | ||||
| @ -42,18 +64,16 @@ cisco/ap-regulatory-domain.1/code0: 0 | ||||
| cisco/ap-regulatory-domain.1/code1: 1 | ||||
| cisco/ap-regulatory-domain.1/set: true | ||||
| cisco/ap-regulatory-domain.1/slot: 1 | ||||
| cisco/ap-static-domain/enable: true | ||||
| cisco/ap-static-domain/name: planix.org | ||||
| cisco/ap-static-ip-addr/address: 192.168.0.13 | ||||
| cisco/ap-static-ip-addr/enabled: true | ||||
| cisco/ap-static-ip-addr/enabled: false | ||||
| cisco/ap-static-ip-addr/gateway: 192.168.0.1 | ||||
| cisco/ap-static-ip-addr/netmask: 255.255.255.0 | ||||
| cisco/ap-static-ip-addr/unknown: 0.0.0.0 | ||||
| cisco/ap-sub-mode: 0 | ||||
| cisco/ap-telnet-ssh/ssh: false | ||||
| cisco/ap-telnet-ssh/telnet: false | ||||
| cisco/ap-uptime/current-uptime: 84 | ||||
| cisco/ap-uptime/last-uptime: 1 | ||||
| cisco/ap-uptime/current-uptime: 36527 | ||||
| cisco/ap-uptime/last-uptime: 36513 | ||||
| cisco/ap-username-and-password/login-credentials/enable-password: $1$qve.$obrsuC2vFk5/TepRMiMxa. | ||||
| cisco/ap-username-and-password/login-credentials/option: 1025 | ||||
| cisco/ap-username-and-password/login-credentials/password: $1$MX4t$F19wCuY8yN5jBD7g2Qutr/ | ||||
| @ -61,14 +81,14 @@ cisco/ap-username-and-password/login-credentials/username: admin | ||||
| cisco/cisco-discovery-protocol/data: 513 | ||||
| cisco/cisco-discovery-protocol/enabled: false | ||||
| cisco/elem132: .x0100000000 | ||||
| cisco/loghost-config/last-joined-ap: None | ||||
| cisco/loghost-config/last-joined-ap: actube_X | ||||
| cisco/loghost-config/loghost: 255.255.255.255 | ||||
| cisco/lw-path-mtu/len: 1095 | ||||
| cisco/lw-path-mtu/max: 1485 | ||||
| cisco/lwelem105: .x0000 | ||||
| cisco/lwelem14: .x000100000000000000000000000000000000 | ||||
| cisco/lwelem105: .x000b | ||||
| cisco/lwelem14: .x000000000000000000000000000000000000 | ||||
| cisco/mcast-mgid-info: .x0000000d0000000000000000000000000000000101000000 | ||||
| cisco/mwar-addr/address: 192.168.0.14 | ||||
| cisco/mwar-addr/address: 192.168.0.24 | ||||
| cisco/mwar-addr/mwar-type: 0 | ||||
| cisco/mwar-addr/unknown: 0 | ||||
| cisco/reset-button-state: true | ||||
| @ -77,7 +97,6 @@ cisco/rouge-and-mss/tcp-adjust-mss: 0 | ||||
| cisco/rouge-detection/rest: .x0000000a | ||||
| cisco/rouge-detection/rouge-detection: true | ||||
| cisco/sig-toggle: true | ||||
| cisco/sig-toogle: true | ||||
| cisco/spam-domain-secret: .xe1ffd18a8f15b3b59c0a47a7f17a96e7cb36174f00 | ||||
| cisco/ssl-certfile: ../../ssl/certs/wtpc.crt | ||||
| cisco/ssl-cipher: SHA1 | ||||
| @ -87,25 +106,29 @@ cisco/wtp-board-data/card-revision: 0 | ||||
| cisco/wtp-board-data/ethernet-mac-address: .xc47d4f3af8a6 | ||||
| cisco/wtp-board-data/options/ant-type: 1 | ||||
| cisco/wtp-board-data/options/ap-type: 1 | ||||
| cisco/wtp-board-data/options/failover-priority: 1 | ||||
| cisco/wtp-board-data/options/failover-priority: 0 | ||||
| cisco/wtp-board-data/options/flex-connect: 1 | ||||
| cisco/wtp-board-data/wtp-model-hi: 0 | ||||
| cisco/wtp-board-data/wtp-model-lo: 0 | ||||
| cisco/wtp-board-data/wtp-serial-number: FCZ1406W232 | ||||
| cisco/wtp-use-ac-version: true | ||||
| idle-timeout: 300 | ||||
| location-data: default location | ||||
| maximum-message-length: 14000 | ||||
| radio.0/admin-state: 1 - enabled | ||||
| radio.0/capwap/admin-state: 1 - enabled | ||||
| radio.0/capwap/decryption-error-report-period: 120 | ||||
| radio.0/capwap/operational-state/cause: Normal | ||||
| radio.0/capwap/operational-state/state: enabled | ||||
| radio.0/capwap80211/rate-set: .x82848b960c1218243048606c | ||||
| radio.0/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||
| radio.0/capwap80211/tx-power/current-tx-power: 1 | ||||
| radio.0/capwap80211/wtp-radio-information: 1 | ||||
| radio.0/cisco/air-space-capability: 0 | ||||
| radio.0/cisco/antenna-payload/802-11n-rx-antennas: 7 | ||||
| radio.0/cisco/antenna-payload/802-11n-tx-antennas: 0 | ||||
| radio.0/cisco/antenna-payload/802-11n-rx-antennas: 3 | ||||
| radio.0/cisco/antenna-payload/802-11n-tx-antennas: 7 | ||||
| radio.0/cisco/antenna-payload/antenna-1: 1 | ||||
| radio.0/cisco/antenna-payload/antenna-2: 1 | ||||
| radio.0/cisco/antenna-payload/antenna-mode: 3 | ||||
| radio.0/cisco/antenna-payload/diversity-selection: 255 | ||||
| radio.0/cisco/antenna-payload/number-of-antennas: 2 | ||||
| radio.0/cisco/antenna-payload/unknown: 3 | ||||
| radio.0/cisco/antenna-payload/unknown: 0 | ||||
| radio.0/cisco/channel-power: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe | ||||
| radio.0/cisco/direct-sequence-control/cfg-type: 1 - global | ||||
| radio.0/cisco/direct-sequence-control/current-cca-mode: 0 | ||||
| @ -117,18 +140,17 @@ radio.0/cisco/elem146: .x690f | ||||
| radio.0/cisco/elem153: .x00 | ||||
| radio.0/cisco/elem156: .x020100 | ||||
| radio.0/cisco/elem16: .x02040b0c | ||||
| radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101 | ||||
| radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101 | ||||
| radio.0/cisco/elem22: .x0d00b400320102030405060708090a0b0c0d | ||||
| radio.0/cisco/elem24: .x003c000c | ||||
| radio.0/cisco/elem47: .x0100000000000000000000000000000000 | ||||
| radio.0/cisco/elem48: .x00 | ||||
| radio.0/cisco/elem81: .x00000000010101010a001e0a02051cbfffbfff0a00 | ||||
| radio.0/cisco/lwelem11: .x00000203 | ||||
| radio.0/cisco/lwelem27: .x00000000000000000000000000000000000000000000000000 | ||||
| radio.0/cisco/lwelem27: .x182c0000000000000000000000000000ffff00000000000000 | ||||
| radio.0/cisco/lwelem28: .x0303020202000000000000000000000000000000000000000000313f01 | ||||
| radio.0/cisco/lwelem29: .x00010000000000000200001400 | ||||
| radio.0/cisco/lwelem29: .x00010100000000000200001400 | ||||
| radio.0/cisco/lwelem48: .x01055a0101a6c405b06432b03232 | ||||
| radio.0/cisco/lwelem55: .x000000000000000000000000 | ||||
| radio.0/cisco/lwelem9: .x0100000000000000000000000000000000 | ||||
| radio.0/cisco/mac-operation/fragmentation-threshold: 2346 | ||||
| radio.0/cisco/mac-operation/long-retry: 4 | ||||
| @ -141,9 +163,11 @@ radio.0/cisco/multi-domain-capability/first-channel: 1 | ||||
| radio.0/cisco/multi-domain-capability/max-tx-power-level: 20 | ||||
| radio.0/cisco/multi-domain-capability/number-of-channels: 13 | ||||
| radio.0/cisco/multi-domain-capability/reserved: 1 | ||||
| radio.0/cisco/radio-module-info/descr: 802.11N 2.4GHz Radio | ||||
| radio.0/cisco/radio-module-info/name: UNKNOWN | ||||
| radio.0/cisco/radio-module-info/serial: FOC14053DBQ | ||||
| radio.0/cisco/radio-module-info/type: Dot11Radio0 | ||||
| radio.0/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000 | ||||
| radio.0/cisco/tx-power/cfg-type: 1 - global | ||||
| radio.0/cisco/tx-power/current-tx-power: 1 | ||||
| radio.0/cisco/wtp-radio-config/beacon-period: 100 | ||||
| radio.0/cisco/wtp-radio-config/bss-id: .x04fe7f499b90 | ||||
| radio.0/cisco/wtp-radio-config/cfg-period: 4 | ||||
| @ -153,10 +177,6 @@ radio.0/cisco/wtp-radio-config/country-str1: "DE " | ||||
| radio.0/cisco/wtp-radio-config/country-str2: "DE " | ||||
| radio.0/cisco/wtp-radio-config/occupancy-limit: 100 | ||||
| radio.0/cisco/wtp-radio-config/reg: 167772416 | ||||
| radio.0/decryption-error-report-period: 120 | ||||
| radio.0/operational-state/cause: Normal | ||||
| radio.0/operational-state/state: enabled | ||||
| radio.0/rate_set: .x82848b960c1218243048606c | ||||
| radio.0/wlan.1/add-wlan/aironet-ie: true | ||||
| radio.0/wlan.1/add-wlan/broadcast-ssid: true | ||||
| radio.0/wlan.1/add-wlan/dtim-period: 1 | ||||
| @ -170,7 +190,7 @@ radio.0/wlan.1/add-wlan/scan-defer-time: 100 | ||||
| radio.0/wlan.1/add-wlan/session-timout: 1800 | ||||
| radio.0/wlan.1/add-wlan/ssid: tubeC | ||||
| radio.0/wlan.1/add-wlan/wep-encryption: false | ||||
| radio.0/wlan.1/add-wlan/wep-key: .x31772582ab25934f97c565949f | ||||
| radio.0/wlan.1/add-wlan/wep-key: .x1978b2c072f90ff26e4e24c806 | ||||
| radio.0/wlan.1/add-wlan/wep-key-index: 1 | ||||
| radio.0/wlan.1/add-wlan/wlan-capability: 1073 | ||||
| radio.0/wlan.1/add-wlan/wlan-id: 1 | ||||
| @ -187,39 +207,45 @@ radio.0/wlan.13/add-wlan/scan-defer-time: 100 | ||||
| radio.0/wlan.13/add-wlan/session-timout: 1800 | ||||
| radio.0/wlan.13/add-wlan/ssid: SuperSSID | ||||
| radio.0/wlan.13/add-wlan/wep-encryption: false | ||||
| radio.0/wlan.13/add-wlan/wep-key: .x31772582ab25934f97c565949f | ||||
| radio.0/wlan.13/add-wlan/wep-key: .x1978b2c072f90ff26e4e24c806 | ||||
| radio.0/wlan.13/add-wlan/wep-key-index: 1 | ||||
| radio.0/wlan.13/add-wlan/wlan-capability: 1057 | ||||
| radio.0/wlan.13/add-wlan/wlan-id: 13 | ||||
| radio.0/wtp-radio-information: 1 | ||||
| radio.1/admin-state: 1 - enabled | ||||
| radio.1/capwap/admin-state: 1 - enabled | ||||
| radio.1/capwap/decryption-error-report-period: 120 | ||||
| radio.1/capwap/operational-state/cause: Normal | ||||
| radio.1/capwap/operational-state/state: enabled | ||||
| radio.1/capwap80211/rate-set: .x8c129824b048606c | ||||
| radio.1/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||
| radio.1/capwap80211/tx-power/current-tx-power: 6 | ||||
| radio.1/capwap80211/wtp-radio-information: 2 | ||||
| radio.1/cisco/air-space-capability: 0 | ||||
| radio.1/cisco/antenna-payload/802-11n-rx-antennas: 7 | ||||
| radio.1/cisco/antenna-payload/802-11n-tx-antennas: 0 | ||||
| radio.1/cisco/antenna-payload/802-11n-rx-antennas: 3 | ||||
| radio.1/cisco/antenna-payload/802-11n-tx-antennas: 7 | ||||
| radio.1/cisco/antenna-payload/antenna-1: 1 | ||||
| radio.1/cisco/antenna-payload/antenna-2: 1 | ||||
| radio.1/cisco/antenna-payload/antenna-mode: 3 | ||||
| radio.1/cisco/antenna-payload/diversity-selection: 255 | ||||
| radio.1/cisco/antenna-payload/number-of-antennas: 2 | ||||
| radio.1/cisco/antenna-payload/unknown: 3 | ||||
| radio.1/cisco/antenna-payload/unknown: 0 | ||||
| radio.1/cisco/channel-power: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe | ||||
| radio.1/cisco/elem145: .x01 | ||||
| radio.1/cisco/elem15/cfg-type: 1 - global | ||||
| radio.1/cisco/elem15/channel: 140 | ||||
| radio.1/cisco/elem15/rest: .x07ffffffce010101 | ||||
| radio.1/cisco/elem15/channel: 56 | ||||
| radio.1/cisco/elem15/rest: .x07ffffffce010001 | ||||
| radio.1/cisco/elem153: .x00 | ||||
| radio.1/cisco/elem156: .x020100 | ||||
| radio.1/cisco/elem16: .x0c121824 | ||||
| radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101 | ||||
| radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101 | ||||
| radio.1/cisco/elem22: .x1000b4003224282c3034383c4064686c707484888c | ||||
| radio.1/cisco/elem24: .x003c000c | ||||
| radio.1/cisco/elem47: .x0100000000000000000000000000000000 | ||||
| radio.1/cisco/elem48: .x00 | ||||
| radio.1/cisco/elem81: .x00000000010101010a001e0a02050fbfffbfff0a00 | ||||
| radio.1/cisco/lwelem11: .x00010203 | ||||
| radio.1/cisco/lwelem27: .x00000000000000000000000000000000000000000000000000 | ||||
| radio.1/cisco/lwelem27: .x186e0000000000000000000000000000ffff00000000000000 | ||||
| radio.1/cisco/lwelem28: .x0303020202000000000000000000000000000000000000000000313f01 | ||||
| radio.1/cisco/lwelem29: .x00010003000000000200001400 | ||||
| radio.1/cisco/lwelem29: .x00018803000000000200002803 | ||||
| radio.1/cisco/lwelem33: .x00 | ||||
| radio.1/cisco/lwelem48: .x01055a0101a6c405b06432b03232 | ||||
| radio.1/cisco/lwelem9: .x0100000000000000000000000000000000 | ||||
| @ -234,9 +260,11 @@ radio.1/cisco/multi-domain-capability/first-channel: 36 | ||||
| radio.1/cisco/multi-domain-capability/max-tx-power-level: 20 | ||||
| radio.1/cisco/multi-domain-capability/number-of-channels: 4 | ||||
| radio.1/cisco/multi-domain-capability/reserved: 1 | ||||
| radio.1/cisco/radio-module-info/descr: 802.11N 5GHz Radio | ||||
| radio.1/cisco/radio-module-info/name: UNKNOWN | ||||
| radio.1/cisco/radio-module-info/serial: FOC14053DBQ | ||||
| radio.1/cisco/radio-module-info/type: Dot11Radio1 | ||||
| radio.1/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000 | ||||
| radio.1/cisco/tx-power/cfg-type: 1 - global | ||||
| radio.1/cisco/tx-power/current-tx-power: 1 | ||||
| radio.1/cisco/wtp-radio-config/beacon-period: 100 | ||||
| radio.1/cisco/wtp-radio-config/bss-id: .x04fe7f499b90 | ||||
| radio.1/cisco/wtp-radio-config/cfg-period: 4 | ||||
| @ -246,10 +274,6 @@ radio.1/cisco/wtp-radio-config/country-str1: "DE " | ||||
| radio.1/cisco/wtp-radio-config/country-str2: "DE " | ||||
| radio.1/cisco/wtp-radio-config/occupancy-limit: 100 | ||||
| radio.1/cisco/wtp-radio-config/reg: 167772416 | ||||
| radio.1/decryption-error-report-period: 120 | ||||
| radio.1/operational-state/cause: Normal | ||||
| radio.1/operational-state/state: enabled | ||||
| radio.1/rate_set: .x8c129824b048606c | ||||
| radio.1/wlan.1/add-wlan/aironet-ie: true | ||||
| radio.1/wlan.1/add-wlan/broadcast-ssid: true | ||||
| radio.1/wlan.1/add-wlan/dtim-period: 1 | ||||
| @ -263,7 +287,7 @@ radio.1/wlan.1/add-wlan/scan-defer-time: 100 | ||||
| radio.1/wlan.1/add-wlan/session-timout: 1800 | ||||
| radio.1/wlan.1/add-wlan/ssid: tubeC | ||||
| radio.1/wlan.1/add-wlan/wep-encryption: false | ||||
| radio.1/wlan.1/add-wlan/wep-key: .x4b0706ccd5d0a8b98b0b4084f1 | ||||
| radio.1/wlan.1/add-wlan/wep-key: .x166ad266a0adea9f140cadf37f | ||||
| radio.1/wlan.1/add-wlan/wep-key-index: 1 | ||||
| radio.1/wlan.1/add-wlan/wlan-capability: 17 | ||||
| radio.1/wlan.1/add-wlan/wlan-id: 1 | ||||
| @ -280,40 +304,17 @@ radio.1/wlan.13/add-wlan/scan-defer-time: 100 | ||||
| radio.1/wlan.13/add-wlan/session-timout: 1800 | ||||
| radio.1/wlan.13/add-wlan/ssid: SuperSSID | ||||
| radio.1/wlan.13/add-wlan/wep-encryption: false | ||||
| radio.1/wlan.13/add-wlan/wep-key: .x4b0706ccd5d0a8b98b0b4084f1 | ||||
| radio.1/wlan.13/add-wlan/wep-key: .x166ad266a0adea9f140cadf37f | ||||
| radio.1/wlan.13/add-wlan/wep-key-index: 1 | ||||
| radio.1/wlan.13/add-wlan/wlan-capability: 1 | ||||
| radio.1/wlan.13/add-wlan/wlan-id: 13 | ||||
| radio.1/wtp-radio-information: 2 | ||||
| radio.2/cisco/lwelem33: .x00 | ||||
| radio.255/admin-state: 1 - enabled | ||||
| radio.255/operational-state/cause: Normal | ||||
| radio.255/operational-state/state: enabled | ||||
| session-id: .x4a230869 | ||||
| statistics-timer: 180 | ||||
| wtp-board-data/board-id: .x0000 | ||||
| wtp-board-data/mac-address: .x0800276edf58 | ||||
| wtp-board-data/model-no: "AIR-LAP1142N-E-K9   " | ||||
| wtp-board-data/revision: A0 | ||||
| wtp-board-data/serial-no: FCZ1406W232 | ||||
| wtp-board-data/vendor: 4232704 | ||||
| wtp-descriptor/bootloader/vendor: 4232704 | ||||
| wtp-descriptor/bootloader/version: .x0c041200 | ||||
| wtp-descriptor/hardware/vendor: 4232704 | ||||
| wtp-descriptor/hardware/version: .x01000000 | ||||
| wtp-descriptor/max-radios: 2 | ||||
| wtp-descriptor/radios-in-use: 2 | ||||
| wtp-descriptor/software/vendor: 4232704 | ||||
| wtp-descriptor/software/version: .x07007400 | ||||
| wtp-fallback: 1 | ||||
| wtp-frame-tunnel-mode: 4 | ||||
| wtp-mac-type: 1 - Split MAC | ||||
| wtp-name: Soft-WTP | ||||
| wtp-reboot-statistics/ac-initiated-count: 1 | ||||
| wtp-reboot-statistics/hw-failure-count: 0 | ||||
| wtp-reboot-statistics/last-failure-type: 1 | ||||
| wtp-reboot-statistics/link-failure-count: 0 | ||||
| wtp-reboot-statistics/other-failure-count: 15 | ||||
| wtp-reboot-statistics/reboot-count: 0 | ||||
| wtp-reboot-statistics/sw-failure-count: 0 | ||||
| wtp-reboot-statistics/unknown-failure-count: 0 | ||||
| radio.255/capwap/admin-state: 1 - enabled | ||||
| radio.255/capwap/operational-state/cause: Normal | ||||
| radio.255/capwap/operational-state/state: enabled | ||||
| radio.255/cisco/radio-module-info/descr: Cisco Aironet 1140 Series (IEEE 802.11n) Access Point | ||||
| radio.255/cisco/radio-module-info/name: AIR-LAP1142N-E-K9 A0 | ||||
| radio.255/cisco/radio-module-info/serial: FCZ1406W232 | ||||
| radio.255/cisco/radio-module-info/type: AP1140 | ||||
| wfat-rem/bind-addr: 0.0.0.0 | ||||
| wfat-rem/discovery-addr: 255.255.255.255 | ||||
|  | ||||
| @ -32,6 +32,8 @@ int configure(struct cw_Conn * conn) | ||||
| 	 | ||||
| 	int rc; | ||||
| 	cw_cfg_copy(conn->global_cfg,conn->update_cfg,0,""); | ||||
|  | ||||
|  | ||||
| 	rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST); | ||||
| 	cw_cfg_clear(conn->update_cfg); | ||||
|  | ||||
|  | ||||
| @ -45,9 +45,9 @@ static struct cw_DiscoveryResults * run_discovery(struct cw_Conn *conn) | ||||
| 	results = cw_discovery_results_create(); | ||||
|  | ||||
| 	 | ||||
| 	min = cw_cfg_get_byte(conn->global_cfg,"capwap-timers/min-discovery-interval", | ||||
| 	min = cw_cfg_get_byte(conn->global_cfg,"capwap/timers/min-discovery-interval", | ||||
| 					CAPWAP_MIN_DISCOVERY_INTERVAL); | ||||
| 	max = cw_cfg_get_byte(conn->global_cfg,"capwap-timers/max-discovery-interval", | ||||
| 	max = cw_cfg_get_byte(conn->global_cfg,"capwap/timers/max-discovery-interval", | ||||
| 					CAPWAP_MAX_DISCOVERY_INTERVAL); | ||||
|  | ||||
| 	delay = cw_randint(min,max); | ||||
| @ -214,7 +214,8 @@ struct cw_DiscoveryResults * cw_run_discovery(struct cw_Conn *conn, const char * | ||||
| 			if (brc < 0) { | ||||
| 				cw_log(LOG_ERR, "Can't bind to %s", | ||||
| 				       sock_addr2str(&bind_address, sock_buf)); | ||||
| 				return 0; | ||||
| 				results = 0; | ||||
| 				goto errX; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| @ -233,6 +234,7 @@ struct cw_DiscoveryResults * cw_run_discovery(struct cw_Conn *conn, const char * | ||||
|  | ||||
|  | ||||
| 	} | ||||
| errX: | ||||
|  | ||||
| 	freeaddrinfo(res0); | ||||
|  | ||||
|  | ||||
| @ -17,6 +17,9 @@ | ||||
| #include "wtp.h" | ||||
|  | ||||
|  | ||||
| int run_join(struct cw_Conn *conn); | ||||
|  | ||||
|  | ||||
| /* | ||||
| #define acinfo_log acinfo_log_ | ||||
|  | ||||
| @ -107,8 +110,8 @@ static int run_join_d(struct cw_Conn * conn, struct sockaddr *sa,cw_Cfg_t * cfg) | ||||
| 	int rc; | ||||
|  | ||||
| 	/* Check if we support the same auth methods as the AC */ | ||||
| 	lsec = cw_cfg_get_byte(conn->global_cfg,"ac-descriptor/security",255); | ||||
| 	rsec = cw_cfg_get_byte(cfg,"ac-descriptor/security",0); | ||||
| 	lsec = cw_cfg_get_byte(conn->global_cfg,"capwap/ac-descriptor/security",255); | ||||
| 	rsec = cw_cfg_get_byte(cfg,"capwap/ac-descriptor/security",0); | ||||
| 	if ((lsec & rsec) == 0){ | ||||
| 		cw_log(LOG_ERR, "Can't establish DTLS with AC, my sec: %d, remote sec %d",lsec,rsec); | ||||
| 		return 0; | ||||
|  | ||||
| @ -84,11 +84,13 @@ int main (int argc, char **argv) | ||||
| 	struct cw_Mod * mod; | ||||
| 	struct cw_MsgSet * msgset=NULL; | ||||
| 	struct cw_Conn * conn=NULL; | ||||
| 	FILE * file; | ||||
| 	//FILE * file; | ||||
| 	cw_Cfg_t * global_cfg =NULL; | ||||
| 	const cw_Type_t ** ti; | ||||
| 	//const cw_Type_t ** ti; | ||||
| 	int i; | ||||
| 	int rc;	 | ||||
| 	int rc=EXIT_FAILURE;	 | ||||
| 	struct cw_DiscoveryResults * results; | ||||
| 	const char *bind_addr, *disc_addr; | ||||
| 	 | ||||
| 	 | ||||
| 	bootcfg.nmods=0; | ||||
| @ -142,6 +144,11 @@ int main (int argc, char **argv) | ||||
| 	conn->dtls_mtu = 1200; | ||||
| 	conn->msgset=msgset; | ||||
| 	conn->global_cfg = global_cfg; | ||||
|  | ||||
| 	conn->cfg_list[0]=conn->update_cfg; | ||||
| 	conn->cfg_list[1]=conn->local_cfg; | ||||
| 	conn->cfg_list[2]=conn->global_cfg; | ||||
| 	conn->cfg_list[3]=NULL; | ||||
| 	 | ||||
| 	conn->role = CW_ROLE_WTP; | ||||
| 	conn->wbid=1; | ||||
| @ -168,17 +175,16 @@ int main (int argc, char **argv) | ||||
| 	conn->base_rmac = get_base_rmac(); | ||||
|  | ||||
|  | ||||
| /*cw_run_discovery(conn, "255.255.255.255","192.168.56.1", &dis);*/ | ||||
| /*	cw_run_discovery(conn, "255.255.255.255",NULL, &dis);*/ | ||||
| 	bind_addr = cw_cfg_get(global_cfg,"wfat/bind-addr","0.0.0.0"); | ||||
| 	disc_addr = cw_cfg_get(global_cfg,"wfat/discovery-addr","255.255.255.255"); | ||||
|  | ||||
|  | ||||
| 	results = cw_run_discovery(conn,disc_addr,bind_addr); | ||||
|  | ||||
|  | ||||
| 	if (!results) | ||||
| 		goto errX; | ||||
|  | ||||
| 	struct cw_DiscoveryResulsts * results; | ||||
| //	cw_run_discovery(conn, "192.168.0.162","192.168.0.14", &dis); | ||||
| 	//cw_run_discovery(conn, "255.255.255.255","192.168.0.14", &dis); | ||||
| //	cw_run_discovery(conn, "192.168.0.255","192.168.0.14", &dis); | ||||
| 	//results = cw_run_discovery(conn, "255.255.255.255","192.168.0.14"); | ||||
| //	results = cw_run_discovery(conn, "255.255.255.255","172.16.67.119"); | ||||
| //	results = cw_run_discovery(conn, "255.255.255.255","172.16.67.185"); | ||||
| 	results = cw_run_discovery(conn, "172.16.67.255","172.16.67.185"); | ||||
|  | ||||
| 	if (!join(conn,results)){ | ||||
| 		cw_discovery_results_destroy(results);  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user