subject

Program structure and design: (Write a C Program to compile in linux) Create a structure type called:
struct address_t
with components for the four integers of an IPv4 address along with a fifth component in which to store an associated alias of up to 10 characters.
Read the file CS222_Inet. txt in order to count the number of records in the file. Provide error checking in order to ensure that each integer portion of the IP address falls within the range [0..255]. If a record contains an illegal IP address, that record is written to the file
222_Error_report and excluded from the 222_Locality_Report
Once the record count has been established, rewind() the file.
Dynamically allocate the proper amount of memory (using malloc()) to store a dynamically allocated array of address_t structures based on the record count.
Dynamically allocate the proper amount of memory (using malloc()) to store a dynamically allocated array of address_t structures based on the record count.
Reread the file and store the data within the dynamically allocated array of address_t structures. Once the array of structures has been populated,
close the CS222_Inet. txt file.
Conditions to write program:
For this exercise you may have a maximum of 2 global variables.
Include at least the following UDFs (You may define your own prototypes):
a) readDataFile
b) generateLocalityRpt
c) getDateAndTime
remember: Max 2 global variable
Sample txt file. (CS222_Inet. txt) to read
194.161.11.166 PLUTO
131.250.182.166 JET
23.88.118.05 WALTER
111.22.217.26 GRIFFITH
194.461.01.166 KRIS
111.22.15.26 ZENITH
131.250.45.215 BAKER
247.276.31.30 SONS
124.95.149.166 FAIROAK
127.88.118.205 SAMUEL
124.95.31.30 BOULER
201.46.182.165 SMITH
192.168.1.2 MATILDA
0.0.0.0 NONE
192.168.1.3 MAYA
192.168.25.45 HARRY
165.25.74.4 PETER
111.22.3.44 TARA
NOTE: Sentinel ip 0.0.0.0 NONE marks the end of reading file and exit loop, it could be anywhere in the file (not necessarily at the end of file)
// Sample output (localityreport. txt)
Sean Howard Jul 10, 2021
CS222 Network Locality Report
Address total:5
Localities: 3
192.168
MATILDA
MAYA
HARRY
111.22
GRIFFITH
ZENITH
131.250
JET
BAKER
// Sample output file (Error_Report. txt)
Sean Howard Jul 10, 2021
CS222 Network Error Report
194.461.01.166 KRIS
247.276.31.30 SONS

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
There is a simple pattern for determining if a binary number is odd. what is it and why does this pattern occur? how many bits would you need if you wanted to have the ability to count up to 1000? how high could you count in binary if you used all 10 of your fingers as bits? (finger up means 1, finger down means 0)
Answers: 3
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
What is the purpose of a computer network needs assessment? to analyze which workers need more training to improve their performance to compare worker productivity to determine what steps employees can take to increase company revenue to evaluate how to move from the current status to the desired goal
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
Someone plzz me which of these defines a social search? a. asking a search engine a question that is answered by a real person on the other sideb. modifying search results based on popularity of a web pagec.modifying search results based on a ranking of a web page
Answers: 2
You know the right answer?
Program structure and design: (Write a C Program to compile in linux) Create a structure type call...
Questions
question
Biology, 11.06.2020 23:57
Questions on the website: 13722367