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 12:30
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
question
Computers and Technology, 22.06.2019 23:00
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Suppose a cpu with a write-through, write-allocate cache achieves a cpi of 2. what are the read and write bandwidths (measured by bytes per cycle) between ram and the cache? (assume each miss generates a request for one block.)
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
Social Studies, 09.06.2020 20:57
Questions on the website: 13722367