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
Expert Solution
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
Recommended textbooks for you
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
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)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY