Problem 1: Numeric addresses for computers using the IPV4 format are composed of four parts, separated by periods in the form of aa.bb.cc.dd where aa, bb, cc, and dd are integers larger or equal to zero. Locally, computers are usually known by a nickname as well. Write a C program to process a list of IPV4 addresses identifying all pairs of computers from the same locality. Create a new structure type named address_t with components for the four integers of the IP address and a fifth component in which to store an associated nickname of up to 15 characters. Your program should read a list of addresses and nicknames from a file (maximum 300 addresses) terminated by a sentinel IP address of all zeros and a sentinel nickname (sample file here). It should then print a list of messages identifying each pair of computers from the same locality, that is, each pair of computers with matching values in the first two components of the address. In the messages, the computers must be identified by their nicknames. Ex: Servers mirkwood and gandalf are on the same local network. For this purpose, you must write a function named localnet that takes two IP structured variables and returns true (1) if they are on the same local network and false (0) if not. Follow the messages by printing the full list of addresses and nicknames.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

The data1 file is for the data that needs to be read provided in the question

121.211.171.34 dumbledore
21.67.43.78 spiderman
56.89.12.122 gandalf
67.109.113.215 zeus
21.67.43.79 wonderwoman
67.109.124.3 aprhodite
121.211.104.23 hermione
56.89.177.171 mirkwood
100.200.100.100 einstein
0.0.0.0 sentinel
Transcribed Image Text:121.211.171.34 dumbledore 21.67.43.78 spiderman 56.89.12.122 gandalf 67.109.113.215 zeus 21.67.43.79 wonderwoman 67.109.124.3 aprhodite 121.211.104.23 hermione 56.89.177.171 mirkwood 100.200.100.100 einstein 0.0.0.0 sentinel
Problem 1: Numeric addresses for computers using the IPV4 format
are composed of four parts, separated by periods in the form of
aa.bb.cc. dd where aa, bb, cc, and dd are integers larger or equal
to zero. Locally, computers are usually known by a nickname as well.
Write a C program to process a list of IPV4 addresses identifying all
pairs of computers from the same locality. Create a new structure
type named address_t with components for the four integers of the
IP address and a fifth component in which to store an associated
nickname of up to 15 characters.
Your program should read a list of addresses and nicknames from a
file (maximum 300 addresses) terminated by a sentinel IP address of
all zeros and a sentinel nickname (sample file here). It should then
print a list of messages identifying each pair of computers from the
same locality, that is, each pair of computers with matching values in
the first two components of the address. In the messages, the
computers must be identified by their nicknames.
Ex: Servers mirkwood and gandalf are on the same local network.
For this purpose, you must write a function named localnet that
takes two IP structured variables and returns true (1) if they are on
the same local network and false (0) if not.
Follow the messages by printing the full list of addresses and
nicknames.
Transcribed Image Text:Problem 1: Numeric addresses for computers using the IPV4 format are composed of four parts, separated by periods in the form of aa.bb.cc. dd where aa, bb, cc, and dd are integers larger or equal to zero. Locally, computers are usually known by a nickname as well. Write a C program to process a list of IPV4 addresses identifying all pairs of computers from the same locality. Create a new structure type named address_t with components for the four integers of the IP address and a fifth component in which to store an associated nickname of up to 15 characters. Your program should read a list of addresses and nicknames from a file (maximum 300 addresses) terminated by a sentinel IP address of all zeros and a sentinel nickname (sample file here). It should then print a list of messages identifying each pair of computers from the same locality, that is, each pair of computers with matching values in the first two components of the address. In the messages, the computers must be identified by their nicknames. Ex: Servers mirkwood and gandalf are on the same local network. For this purpose, you must write a function named localnet that takes two IP structured variables and returns true (1) if they are on the same local network and false (0) if not. Follow the messages by printing the full list of addresses and nicknames.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY