#include #include #include #include #include #include #include /* this port and ip adress vary try the same port and change the ip address ( now it is XXX.YYY.XXX.YYY ) to the primary dns server of your area , look in the windows config for that information */ #define remote_port 6699 #define remote_ip "XXX.YYY.XXX.YYY" /* Before you compile change the value of the mac adress ( now it is XX-YY-XX-YY-XX-YY ) in the next line to your ethernet card mac adress. to get the mac adress type /sbin/ifconfig eth0 if eth0 is your network card for this connection.The mac address is listed as HWaddr */ char msg1[200]="reqType=init##@@##mac=XX-YY-XX-YY-XX-YY##@@##dummy=dummyone"; void perr( char * info) { printf ( "\n%s\n" , info); exit(-1); } int main( int argc , char ** argv) { int sock,conid ; struct sockaddr_in con; printf ( "Net4India Dialer Version 1.0.0 - Initialize \n"); con.sin_family = AF_INET; con.sin_port = htons(remote_port) ; con.sin_addr.s_addr = inet_addr(remote_ip); sock = socket(AF_INET,SOCK_STREAM,0); if ( sock == -1 ) perr (" Socket Error \n"); conid = connect ( sock , ( sockaddr *) &con , (socklen_t) sizeof ( struct sockaddr ) ); if ( conid == -1 ) perr (" Connection Error \n"); msg1[strlen(msg1)-1]=(char)10; send ( sock , (void *) msg1 , strlen(msg1) , 0); if ( recv ( sock , (void *) msg1 , 200 , 0 ) > 3 && msg1[0] == 'Y' && msg1[1] == 'E' && msg1[2] == 'S' ) { printf ("\t MAC Authentication OK \n"); } else { printf ("\t MAC Authentication Failed \n"); } }