VirtualBox

Changeset 26588 in vbox for trunk/include


Ignore:
Timestamp:
Feb 16, 2010 5:02:59 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57776
Message:

iprt: New type RTNETADDR for storing any address + type + port. Added %RTnaddr for printing it.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/net.h

    r25645 r26588  
    5858typedef RTUINT128U RTNETADDRIPV6;
    5959AssertCompileSize(RTNETADDRIPV6, 16);
    60 /** Pointer to a IPv4 address. */
     60/** Pointer to a IPv6 address. */
    6161typedef RTNETADDRIPV6 *PRTNETADDRIPV6;
    62 /** Pointer to a const IPv4 address. */
     62/** Pointer to a const IPv6 address. */
    6363typedef RTNETADDRIPV6 const *PCRTNETADDRIPV6;
    6464
     
    8282
    8383/**
    84  * Address union.
     84 * Network address union.
     85 *
     86 * @remarks The size of this structure may change in the future.
    8587 */
    8688typedef union RTNETADDRU
     
    109111typedef RTNETADDRU const *PCRTNETADDRU;
    110112
     113/**
     114 * Network address type.
     115 *
     116 * @remarks The value assignments may change in the future.
     117 */
     118typedef enum RTNETADDRTYPE
     119{
     120    /** The invalid 0 entry. */
     121    RTNETADDRTYPE_INVALID = 0,
     122    /** IP version 4. */
     123    RTNETADDRTYPE_IPV4,
     124    /** IP version 6. */
     125    RTNETADDRTYPE_IPV6,
     126    /** IPX. */
     127    RTNETADDRTYPE_IPX,
     128    /** MAC address. */
     129    RTNETADDRTYPE_MAC,
     130    /** The end of the valid values. */
     131    RTNETADDRTYPE_END,
     132    /** The usual 32-bit hack. */
     133    RTNETADDRTYPE_32_BIT_HACK = 0x7fffffff
     134} RTNETADDRTYPE;
     135/** Pointer to a network address type. */
     136typedef RTNETADDRTYPE *PRTNETADDRTYPE;
     137/** Pointer to a const network address type. */
     138typedef RTNETADDRTYPE const  *PCRTNETADDRTYPE;
     139
     140/**
     141 * Network address.
     142 *
     143 * @remarks The size and type values may change.
     144 */
     145typedef struct RTNETADDR
     146{
     147    /** The address union. */
     148    RTNETADDRU      uAddr;
     149    /** Indicates which view of @a u that is valid. */
     150    RTNETADDRTYPE   enmType;
     151    /** The port number for IPv4 and IPv6 addresses.  This is set to
     152     *  RTNETADDR_NA_PORT if not applicable. */
     153    uint32_t        uPort;
     154} RTNETADDR;
     155/** Pointer to a network address. */
     156typedef RTNETADDR *PRTNETADDR;
     157/** Pointer to a const network address. */
     158typedef RTNETADDR const *PCRTNETADDR;
     159
     160/** The not applicable value of  RTNETADDR::uPort value use to inid. */
     161#define RTNETADDR_PORT_NA       UINT32_MAX
    111162
    112163/**
  • trunk/include/iprt/tcp.h

    r25724 r26588  
    3434#include <iprt/types.h>
    3535#include <iprt/thread.h>
     36#include <iprt/net.h>
    3637
    3738#ifdef IN_RING0
     
    224225#endif
    225226
     227/**
     228 * Gets the address of the other party.
     229 *
     230 * @returns IPRT status code.
     231 * @param   Sock            Socket descriptor.
     232 * @param   pAddr           Where to store the peer address on success.
     233 */
     234RTR3DECL(int) RTTcpGetPeerAddress(RTSOCKET Sock, PRTNETADDR pAddr);
    226235
    227236/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette