Working ...
FossilOrigin-Name: 76683772133379e4ebd35973998048a7dfc1f5ff63deb2182f849c1390c67a92
This commit is contained in:
		| @ -101,6 +101,7 @@ OBJS += $(CONFOBJS) | |||||||
|  |  | ||||||
|  |  | ||||||
| OBJS += nlt_attrnames.o | OBJS += nlt_attrnames.o | ||||||
|  | OBJS += nlt_cmdnames.o | ||||||
|  |  | ||||||
| #OBJS += $(HA_FILES) | #OBJS += $(HA_FILES) | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,22 +1,47 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
| $data = file_get_contents("nl80211attr.txt"); | function enum2_array($data,$arrayname,$comment) | ||||||
|  | { | ||||||
|  | 	$str = ""; | ||||||
| 	$values = explode(",",$data); | 	$values = explode(",",$data); | ||||||
|  |  | ||||||
| echo "/* | 	$str.=$comment; | ||||||
|  Generated by php | 	$str.= "char * $arrayname"."[] = {\n"; | ||||||
|  |  | ||||||
|  | 	$c=""; | ||||||
|  | 	foreach($values as $val){ | ||||||
|  | 		$str.= $c.'"'.trim($val).'"'; | ||||||
|  | 		$c=",\n"; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	$str.= "\n};"; | ||||||
|  | 	return $str; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | $data = file_get_contents("nl80211attr.txt"); | ||||||
|  | $arrayname="nlt_attrnames"; | ||||||
|  | $comment = "/* | ||||||
|  |  Generated by enum2array.php | ||||||
|  Do not modify |  Do not modify | ||||||
| */ | */ | ||||||
| "; | "; | ||||||
|  |  | ||||||
|  | $r = enum2_array($data,$arrayname,$comment); | ||||||
|  | file_put_contents('nlt_attrnames.c',$r); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | $data = file_get_contents("nl80211cmd.txt"); | ||||||
|  | $arrayname="nlt_cmdnames"; | ||||||
|  | $comment = "/* | ||||||
|  |  Generated by enum2array.php | ||||||
|  |  Do not modify | ||||||
|  | */ | ||||||
|  | "; | ||||||
|  |  | ||||||
|  | $r = enum2_array($data,$arrayname,$comment); | ||||||
|  | file_put_contents('nlt_cmdnames.c',$r); | ||||||
|  |  | ||||||
| echo "char nlt_attrname[] = {\n"; |  | ||||||
| $c=""; |  | ||||||
| foreach($values as $val){ |  | ||||||
| 	echo $c.'"'.trim($val).'"'; |  | ||||||
| 	$c=",\n"; |  | ||||||
|  |  | ||||||
| } |  | ||||||
| echo "\n};"; |  | ||||||
|  | |||||||
| @ -1,11 +1,13 @@ | |||||||
| #ifndef __NLT_H | #ifndef __NLT_H | ||||||
| #define __NLT_H | #define __NLT_H | ||||||
|  |  | ||||||
|  | #include "nl80211.h" | ||||||
|  |  | ||||||
| extern const char * nlt_attrnames[]; | extern const char * nlt_attrnames[]; | ||||||
|  | extern const char * nlt_cmdnames[]; | ||||||
|  |  | ||||||
| #define nlt_get_attrname(type) nlt_attrnames[type] | #define nlt_get_attrname(type) nlt_attrnames[type] | ||||||
|  | #define nlt_get_cmdname(cmd) (cmd>NL80211_CMD_MAX? "Unknown": nlt_cmdnames[cmd]) | ||||||
|  |  | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -1,10 +1,8 @@ | |||||||
| #include "nlt.h" |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  Generated by php |  Generated by enum2array.php | ||||||
|  Do not modify |  Do not modify | ||||||
| */ | */ | ||||||
| const char *  nlt_attrnames[] = { | char * nlt_attrnames[] = { | ||||||
| "NL80211_ATTR_UNSPEC", | "NL80211_ATTR_UNSPEC", | ||||||
| "NL80211_ATTR_WIPHY", | "NL80211_ATTR_WIPHY", | ||||||
| "NL80211_ATTR_WIPHY_NAME", | "NL80211_ATTR_WIPHY_NAME", | ||||||
|  | |||||||
| @ -57,8 +57,6 @@ const char * interfaces[]={ | |||||||
|  |  | ||||||
| int main() | int main() | ||||||
| { | { | ||||||
| 	gr(); |  | ||||||
| 	exit(0); |  | ||||||
| 	wtp_main(); | 	wtp_main(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @ -94,6 +92,8 @@ int do_connect(void *priv,void *data) | |||||||
| int wtp_main(const char *ad) | int wtp_main(const char *ad) | ||||||
| { | { | ||||||
| 	cw_dbg_opt_level = DBG_DTLS | DBG_CW_INFO | DBG_ALL; | 	cw_dbg_opt_level = DBG_DTLS | DBG_CW_INFO | DBG_ALL; | ||||||
|  | 	gr(); | ||||||
|  | 	exit(0); | ||||||
|  |  | ||||||
| 	wtpconf_preinit(); | 	wtpconf_preinit(); | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user