Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Convert between IPv4 and IPv6!

Posted on 2005-04-05
6
Medium Priority
?
5,936 Views
Last Modified: 2008-03-17
Hello...

I need to convert a IPv4 address into an equalent IPv6 address...
Maybe something like "127.0.0.1" -> "abcd:ef12::3456:7890"...

You can use the NET-Framework, but Windows API would be better...
Or if you have another solution... please tell it...

Thanks for advance!!!
0
Comment
Question by:ChristopH1987
  • 2
4 Comments
 
LVL 8

Expert Comment

by:_corey_
ID: 13711617
Using the correct Winsock2 functions you are able to use IPv4 and IPv6 addresses together, would you like a solution along those lines?

corey
0
 
LVL 8

Expert Comment

by:_corey_
ID: 13728910
Well, anyway, what you need to do is get the new PlatformSDK (or if you have VS.NET) and use the Winsock2 API.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp ["getaddrinfo"]

Has the proper interface to get an address info in IPv6 structures using the family PF_INET6.

corey
0
 
LVL 2

Author Comment

by:ChristopH1987
ID: 13729825
thanks...

can you please tell me how I can use this routine for AF_INET6... I called it like in the SDK but no address is saved and error 10047 is retuned if I call bind()...


Thanks for advance
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 14526833
PAQed with points (500) refunded

DarthMod
Community Support Moderator
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question