I'm writing a proxy server, and I have a filter file that contains sub-networks (n1.n2.n3.n4/x) and host names. Each IP address that it first x MSB are identical to one from the list should be ignored, so as the host names.
My initial thought was to read the file and hold two lists;
The first
struct Subnet{
char* IP
int mask
Subnet* next
};
The second
struct Host_name{
char* host
Host_name* next
};
But I think that using some existing structs (such as in addr
) will be better.
I would appreciate any advice on the subject