extern short ap_type, ap_vendorext;
extern struct in_addr ap_ip;
extern int atmel410_filter;
+
#define MAX_LINES LINES-6
struct APList {
{
extern char *community;
extern struct in_addr ap_ip;
- extern int sockfd;
-
+
char *home_dir, buf[1024], mess[64];
char message[50];
int c, fd, rval = 0, pos;
signed int j, i, begin, end, record_num = 0;
struct APList *first = NULL, *curr = NULL, *pmac;
- struct sockaddr_in client;
-
- memset(&client, 0, sizeof client);
- client.sin_family = AF_INET;
- client.sin_port = INADDR_ANY;
- client.sin_addr.s_addr = INADDR_ANY;
if ((home_dir = getenv("HOME")) == NULL)
return 0;
strncpy(community, curr->passwd, i);
ap_type = curr->type;
ap_vendorext = curr->vendorext;
- rval = 1;
- if (sockfd)
- close(sockfd);
-
- if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
- rval = 0;
- if (bind(sockfd, (struct sockaddr *) &client, SIZE) == -1)
+ rval = 1;
+ if (reopen_sockfd() == -1)
rval = 0;
print_bottom(inet_ntoa(ap_ip));
strncpy(community, curr->passwd, i);
ap_type = curr->type;
ap_vendorext = curr->vendorext;
- rval = 1;
- if (sockfd)
- close(sockfd);
- if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
- rval = 0;
-
- if (bind(sockfd, (struct sockaddr *) &client, SIZE) == -1)
+ rval = 1;
+ if (reopen_sockfd() == -1)
rval = 0;
print_bottom(inet_ntoa(ap_ip));