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.
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...
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbd995525-d253-4921-8ccc-4f78fb9f767e%2Fa1507380-b5d0-414a-8fe8-311fd4ddc61f%2Fx64ad1o_processed.png&w=3840&q=75)
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbd995525-d253-4921-8ccc-4f78fb9f767e%2Fa1507380-b5d0-414a-8fe8-311fd4ddc61f%2F9kvk43_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY