blob: bf8f28b54398860516e39fb6dde3203471fdc50e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <stdio.h>
int main(int argc,char *argv[]) {
char *wanip;
if(argc < 2) {
return printf("usage: %s [IP]\n",argv[0]);
}
if(!strncmp(argv[1],"127.",4)) {
wanip="127.0.0.1";
}
else if(!strncmp(argv[1],"1.",2)) {
wanip="1.41.41.1";
}
else if(!strncmp(argv[1],"192.168.0.",10)) {
wanip="192.168.0.2";
} else {
wanip="98.159.69.172";
}
return printf("%u\n",htonl(inet_addr(wanip)));
}
|