Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
How to Look Up Port Numbers in Unix and Windows with C Programming

Part I: Looking up port #s

Part I: Looking up port #sThe file /etc/services is a lookup table of common services and their standard default port numbers available in Unix as defined by IANA – the Internet Assigned Numbers Authority. In Windows this table also appears in the file  The official list of standard port assignments can be found here:  1. Write and test a function in C char * getportname(portNo) based on the sample program services.c that reads in the /etc/services file one line at a time, tokenizes each line and returns the default text name for the port. Return 0 or -1 if the name does not exist. (2) 2. Write and test a similar function int getportnum(portNo) based on the sample program services.c that reads in the /etc/services file one line at a time, tokenizes each line, checks both the default name and the aliases and returns the associated port #. If the port does not exist it should return 0 (an invalid port #) or -1. (2) 3. Write a small command server that accepts 2 command to test a. & b: (4) a. port portNo #displays the default name or a not found message b. service name #display the port # associated with the name c. Create a test file of 5 searches for ports#s and 5 searches for port names including 2 examples using aliases and an example of an invalid port and an invalid name. Feed the list of commands to your program.

support
close