[Win32] Wrapping in_addr in a class

This is a discussion on [Win32] Wrapping in_addr in a class within the Networking/Device Communication forums, part of the General Programming Boards category; I'm trying to make a neat wrapper that wraps the IP address structures. However, I'm grappling with how to make ...

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    [Win32] Wrapping in_addr in a class

    I'm trying to make a neat wrapper that wraps the IP address structures. However, I'm grappling with how to make the class both IPv4 and IPv6 friendly. Can anyone provide any resources (code snippets, links, etc) that can shed some light on how I may approach my design?

    Thanks!
    Founder and avid member of the Internationsl Typo Associateion

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,628
    Just don't use the IPv4 in_addr class. If your wrapper gets passed an IPv4, simply properly load it into the IPv6 class, by taking advantage of it's backwards-compatibility.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 08:10 AM
  3. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  4. Replies: 7
    Last Post: 05-26-2005, 10:48 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21