Loading...
Searching...
No Matches

Link-layer helper function definitions. More...

Detailed Description

Link-layer helper function definitions.

Author
Martine Lenders m.len.nosp@m.ders.nosp@m.@fu-b.nosp@m.erli.nosp@m.n.de

Definition in file l2util.h.

#include <stdint.h>
#include "net/eui64.h"
#include "net/ndp.h"
+ Include dependency graph for l2util.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define L2UTIL_ADDR_MAX_LEN   (8U)
 maximum expected length for addresses
 

Functions

int l2util_eui64_from_addr (int dev_type, const uint8_t *addr, size_t addr_len, eui64_t *eui64)
 Converts a given hardware address to an EUI-64.
 
int l2util_ipv6_iid_from_addr (int dev_type, const uint8_t *addr, size_t addr_len, eui64_t *iid)
 Converts a given hardware address to an IPv6 IID.
 
int l2util_ipv6_iid_to_addr (int dev_type, const eui64_t *iid, uint8_t *addr)
 Converts an IPv6 IID to a hardware address.
 
int l2util_ndp_addr_len_from_l2ao (int dev_type, const ndp_opt_t *opt)
 Derives the length of the link-layer address in an NDP link-layer address option from that option's length field and the given device type.
 
int l2util_ipv6_group_to_l2_group (int dev_type, const ipv6_addr_t *ipv6_group, uint8_t *l2_group)
 Converts an IPv6 multicast address to a multicast address of the respective link layer.
 
char * l2util_addr_to_str (const uint8_t *addr, size_t addr_len, char *out)
 Converts a hardware address to a human readable string.
 
size_t l2util_addr_from_str (const char *str, uint8_t *out)
 Parses a string of colon-separated hexadecimals to a hardware address.
 
static bool l2util_addr_equal (const uint8_t *addr_a, uint8_t addr_a_len, const uint8_t *addr_b, uint8_t addr_b_len)
 Checks if two l2 addresses are equal.