mptcpd
Multipath TCP Daemon
Loading...
Searching...
No Matches
Classes
hash_sockaddr.h File Reference

struct sockaddr hash related functions. More...

#include <stdint.h>
Include dependency graph for hash_sockaddr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mptcpd_hash_sockaddr_key
 Hash key information. More...
 

Functions

ELL Hash Functions For IP Addresses

A set of types and functions for using an IP address through a struct sockaddr as the key for an ELL hashmap (struct l_hashmap).

Note
These functions are only used internally, and are not exported from libmptcpd.
int mptcpd_hash_sockaddr_compare (void const *a, void const *b)
 Compare hash map keys based on IP address alone.
 
void * mptcpd_hash_sockaddr_key_copy (void const *p)
 Deep copy the hash map key p.
 
void mptcpd_hash_sockaddr_key_free (void *p)
 

Detailed Description

struct sockaddr hash related functions.

Copyright (c) 2022, Intel Corporation

Function Documentation

◆ mptcpd_hash_sockaddr_compare()

int mptcpd_hash_sockaddr_compare ( void const *  a,
void const *  b 
)

Compare hash map keys based on IP address alone.

Parameters
[in]aPointer struct sockaddr (left hand side).
[in]bPointer struct sockaddr (right hand side).
Returns
0 if the IP addresses are equal, and -1 or 1 otherwise, depending on IP address family and comparisons of IP addresses of the same type.
Note
Ports are not compared.

◆ mptcpd_hash_sockaddr_key_copy()

void * mptcpd_hash_sockaddr_key_copy ( void const *  p)

Deep copy the hash map key p.

Returns
The dynamically allocated deep copy of the hash map key p. Deallocate with l_free().