Question: C Code, Network Layer: Connect to the data-link layer? Overall: Need to create and send a message through a network layer, data link layer and

C Code, Network Layer: Connect to the data-link layer?

Overall: Need to create and send a message through a network layer, data link layer and physical layer.

I get the feeling most of this is wrong, how would I fix it, if not can it be explained why it should be working?

Code so far:

C Code, Network Layer: Connect to the data-link layer? Overall: Need to

21 add codes for Local variables int sockfd, portno, nj struct sockaddr_in servaddr; struct hostent *server; packet incoming_packet, outgoing_packet; char buffer [256]; 25 26 54 Fadd codes to connect to the data-Link Layer/ po rtno = atoi(argv[2]); 56 57 58 59 60 61 62 63 64 65 e); sockfd = socket (AF_INET, if(sockfd SOCK-STREAM, error( ERROR opening socket") server = gethostbyname(argv[1]); if(server == NULL){ fprintf(stderr, "ERROR, no suck hostln")5 exit(0); 67 68 69 70 71 72 bzero((char *) &serv_addr, sizeof (serv_addr)) serv addr.sin familyAF INET /bcopy((char )server->h addr, (char *)&serv addr.sin addr.s_addr, server->h length); //printf ("server ips Xun", server->h.addr ); //serv-addr.sin-port htons(portno)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!