Skip to main content

Posts

Showing posts from March, 2014

ARP/RARP full simulation program

server.c #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #define SA struct sockaddr struct IPmac { char ip[100]; char mac[100]; }; int main() { int sockfd,len,i; struct sockaddr_in servaddr; char buff[30],temp[30],ip[30],mac[30];

FTP simulation to read the file contents

server.c #include "stdio.h" #include "string.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #define SA struct sockaddr int main(int argc,char** argv) { int sockfd; int n=0,clilen; char fname[20],content[2000],ch; FILE *fp; struct sockaddr_in servaddr,cliaddr; if(argc!=2) { printf("usage ./server PORT\n"); return 0; }

UDP echo server, client

udpserver.c #include "stdio.h" #include "stdlib.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #include "string.h" #define SA struct sockaddr #define MAX 1024 int main(int argc,char** argv) { int sockfd,n; socklen_t len; struct sockaddr_in servaddr,cliaddr; char buff[MAX],tmp[MAX]; //create socket sockfd = socket(AF_INET,SOCK_DGRAM,0);

This Week's Experiments

Experimenting LEOXSYS-nano wifi adapter: Recently bought this tiny wifi adapter from flipkart. Making this wifi-adapter able to work is wont be problem under windows. But in LINUX it need some patience. Linux Kernel doesn't have the supportive drivers to make it workable on linux. Thank god they gave one small disc which contains the drivers for this wifi-adapter. Inside the disk there are various folders and finally found one Linux folder in it. Make sure you copy that into your home directory not to any others. (We are going to make it and install it. It needs a folder permission to execute some utility programs) then make it and install it, and it works just fine in my LinuxMint 14. Soon to register for a wifi connection in my campus :-) Making Balance enquiry of the usb modem from Terminal This one is my favourite trick to know the balance amount of my 3g dongle. All you need is one tiny little program called gammu.