diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-03-06 10:48:06 +0100 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-03-06 12:11:22 +0000 |
commit | 0e98ba7a3100268e656fe5e3a21783a5ab6daa53 (patch) | |
tree | 2492478ca915291c8f0816426bbddc7d319393c0 /hicn-light/src/utils/address.h | |
parent | 9d0002e5cb97d939f2f74ab1e635b616d634e7db (diff) |
[HICN-92] Fix byte order mismatch in create listener command
Change-Id: I750b9840543cf53e0d96bd71a0765bd6345013cb
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-light/src/utils/address.h')
-rw-r--r-- | hicn-light/src/utils/address.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hicn-light/src/utils/address.h b/hicn-light/src/utils/address.h index d8b0efcab..ca3141ede 100644 --- a/hicn-light/src/utils/address.h +++ b/hicn-light/src/utils/address.h @@ -144,6 +144,30 @@ Address *addressCreateFromInet(struct sockaddr_in *addr_in); Address *addressCreateFromInet6(struct sockaddr_in6 *addr_in6); /** + * Convert an internet address family (IPv4) to the address format used by the + * Fwd. + * + * @param [in] addr4 IPV4 address in *Network byte order* + * @param [in] port Port number in *Network byte order* + * + * @return A new instance of `Address` that must eventually be destroyed by + * calling {@link addressDestroy}() + */ +Address *addressFromInaddr4Port(in_addr_t *addr4, in_port_t *port); + +/** + * Convert an internet address family (IPv6) to the address format used by the + * Fwd + * + * @param [in] addr6 IPV4 address in *Network byte order* + * @param [in] port Port number in *Network byte order* + * + * @return A new instance of `Address` that must eventually be destroyed by + * calling {@link addressDestroy}() + */ +Address *addressFromInaddr6Port(struct in6_addr *addr6, in_port_t *port); + +/** * Create a new `Address` instance, initialized from a Link address. * * User must know the link address format (i.e. token ring vs ethernet) and have |