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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:00, yeet74
I'm taking a class on how to make a movie, and it offers some apps that would be in the process. the thing is, i don't have any of those ha. if you have any tips on some apps i could use, that would be awesome. i don't have an iphone, so don't suggest any apps like imovie. i know that this is a weird question, but it would be super for me. : )
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, jc624826
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
image
Computers and Technology, 22.06.2019 23:50, Crull5999
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
image
Computers and Technology, 24.06.2019 15:30, taylorpayne525p8qxky
What is not a type of text format that will automatically be converted by outlook into a hyperlink?
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 in other subjects:

Konu
Social Studies, 23.09.2019 09:10