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, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
question
Computers and Technology, 24.06.2019 15:40
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
question
Computers and Technology, 24.06.2019 17:50
Which of the following best describe how the depth-limited search works. a normal depth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but values above a specific value will be ignored. a normal depth-first search is performed but values above a specific value will be ignored.
Answers: 1
You know the right answer?
Program structure and design: (Write a C Program to compile in linux) Create a structure type call...
Questions
question
Mathematics, 21.05.2020 07:04
question
Mathematics, 21.05.2020 07:04
question
History, 21.05.2020 07:57
Questions on the website: 13722361