[ap-utils] An AP name check patch

Jacek Pliszka pliszka at fuw.edu.pl
Tue Nov 11 12:37:02 EET 2003


Hi!

I found out that sometimes the data returned by SNMP is garbled
- the AP name does not agree- this indicates problems with AP.

For detection of such situations I added -n name option to ap-mrtg
that, if used, checks if name of the AP polled is same as one given.

If you find it useful - please add it to the CVS.

BR,

Jacek


-------------- next part --------------
46c46
< 	   ("\tap-mrtg -i ip -c community -t type [-b bssid] [-v] [-h] [-r]\n\n"));
---
> 	   ("\tap-mrtg -i ip -c community -t type [-b bssid] [-n name] [-v] [-h] [-r]\n\n"));
54a55
>     printf(_("-n name     - AP name - for check only\n")); 
118,119c119,120
<     char message[12], bssid_flag, stat_type = 0, *ERR_STR =
< 	ERR_STR_N, *bssid = NULL;
---
>     char message[12], bssid_flag,  stat_type = 0, *ERR_STR =
> 	ERR_STR_N, *bssid = NULL, *name = NULL;
140c141
< 	switch (opt = getopt(argc, argv, "i:c:t:b:rv")) {
---
> 	switch (opt = getopt(argc, argv, "i:c:t:b:n:rv")) {
160a162,165
> 	case 'n':
> 	    name = malloc(strlen(optarg) + 1);
> 	    strncpy(name, optarg, strlen(optarg) + 1);
> 	    break;
346a352
> 
354a361
> 
359a367,371
>     if ( name != NULL ) 
>       if (strncmp(name,varbinds[0].value,strlen(name)) ){
> 	return 2;
>       }
>     
366a379,380
>     if (name)
> 	free(name);


More information about the ap-utils mailing list