Fixed segfaulting access control, allowed change to acl via control socket.

This commit is contained in:
Matthew Bloch
2012-05-19 12:48:03 +01:00
parent 580b821f61
commit 8a38cf48eb
8 changed files with 257 additions and 104 deletions

24
parse.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef __PARSE_H
#define __PARSE_H
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
union mysockaddr {
unsigned short family;
struct sockaddr generic;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
};
struct ip_and_mask {
union mysockaddr ip;
int mask;
};
int parse_ip_to_sockaddr(struct sockaddr* out, char* src);
int parse_acl(struct ip_and_mask *out[], int max, char **entries);
#endif