#include 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))); }