Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

IN C language!!! IPV6 String Checker: IPV6 is the new form of IP the internet is slowly transitioning to. It is represented by 8 groups

IN C language!!! IPV6 String Checker:

IPV6 is the new form of IP the internet is slowly transitioning to. It is represented by 8 groups of 4 hexadecimal digits separated by a semi-colon. ToYour boss has asked you to create an IPV6 address checker. Read in from a file n number of ipv6 addresses and check each one for validity. For each string print the string out and say if its valid to the user.

Follow these rules for ipv6: IPv6 provides some rules to shorten the address. The rules are as follows:

Rule.1: Discard leading Zero(es): In Block 5, 0063, the leading two 0s can be omitted, such as (5th block):

2001:0000:3238:DFE1:63:0000:0000:FEFB

Rule.2: If two of more blocks contain consecutive zeroes, omit them all and replace with double colon sign ::, such as (6th and 7th block):

2001:0000:3238:DFE1:63::FEFB

Consecutive blocks of zeroes can be replaced only once by :: so if there are still blocks of zeroes in the address, they can be shrunk down to a single zero, such as (2nd block):

2001:0:3238:DFE1:63::FEFB

There is one specific edge case you should watch out for, :: is NOT a valid ipv6 address. A few more examples 0000:1000:0000:0000:0000:0000:0000:0000 is equally as valid as

0:1000:0:0:0:0:0:0 which is as valid as 0:1000:: ::1:: is NOT valid however. Feel free to use any library you want, except for any ipv6 libraries.

teststring.txt 0000:0000:0000:0000:0000:0000:0000:0001 ::0001 fe80:0000:0000:0000:a299:9bff:fe18:50d1 fe80::::a299:9bff:fe18:50d1 fe80:0:0:0:a299:9bff:fe18:50d1 LOLOKAY 1234:dead:beef:1234:: fe80:0000:0000:0000:a299:9bff:fe18:50d1:1234 fe80:0000:0000:0000:a299:9bff:f-18:50d1 fe80s:0000:0000:0000:a29ss9:s9bff:fess18:50d1 0000:0000:0000:0000:0000:0000:0000:0000 hgds:fdsk:0000:0000:0000:0000:0000:0000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students explore these related Databases questions