Zephyr Project
3.0.99

Contents

  • Introduction
  • Getting Started Guide
  • Contribution Guidelines
  • Development and Contribution Process
  • Build and Configuration Systems
  • Application Development
  • API Reference
    • API Status and Guidelines
    • Audio
    • Asynchronous Notifications
    • Bluetooth
    • Controller Area Network (CAN)
    • Crypto
    • Devicetree
    • Device Driver Model
    • Display Interface
    • Error Detection And Correction (EDAC)
    • File Systems
    • Iterable Sections
    • Formatted Output
    • Kernel Services
    • C standard library
    • Logging
    • Memory Management
    • Miscellaneous
    • Data Structures
    • Modbus
    • Networking
      • Network APIs
      • Network Buffer Management
      • Networking Technologies
      • Protocols
      • Network System Management
        • Network Configuration Library
        • DHCPv4
        • Hostname Configuration
        • Network Core Helpers
        • Network Interface
        • L2 Layer Management
        • Network Traffic Offloading
        • Link Layer Address Handling
        • Ethernet Management
        • Traffic Classification
        • Network Packet Filtering
        • Network Shell
      • Time Sensitive Networking
      • Generic GSM Modem
    • Peripherals
    • Pin Control
    • Power Management
    • Random Number Generation
    • Resource Management
    • Shell
    • Storage
    • Task Watchdog
    • Time Utilities
    • USB device support
    • User Mode
    • Utilities
    • Settings
    • Executing Time Functions
    • Virtualization
  • User and Developer Guides
  • Security
  • Samples and Demos
  • Supported Boards
  • Release Notes
Zephyr Project
  • »
  • API Reference »
  • Networking »
  • Network System Management »
  • Link Layer Address Handling
  • View page source

Link Layer Address Handling¶

  • Overview

  • API Reference

Overview¶

The link layer addresses are set for network interfaces so that L2 connectivity works correctly in the network stack. Typically the link layer addresses are 6 bytes long like in Ethernet but for IEEE 802.15.4 the link layer address length is 8 bytes.

API Reference¶

group net_linkaddr

Network link address library.

Defines

NET_LINK_ADDR_MAX_LENGTH¶

Maximum length of the link address

Enums

enum net_link_type¶

Type of the link address. This indicates the network technology that this address is used in. Note that in order to save space we store the value into a uint8_t variable, so please do not introduce any values > 255 in this enum.

Values:

enumerator NET_LINK_UNKNOWN = 0¶

Unknown link address type.

enumerator NET_LINK_IEEE802154¶

IEEE 802.15.4 link address.

enumerator NET_LINK_BLUETOOTH¶

Bluetooth IPSP link address.

enumerator NET_LINK_ETHERNET¶

Ethernet link address.

enumerator NET_LINK_DUMMY¶

Dummy link address. Used in testing apps and loopback support.

enumerator NET_LINK_CANBUS_RAW¶

CANBUS link address.

Functions

static inline bool net_linkaddr_cmp(struct net_linkaddr *lladdr1, struct net_linkaddr *lladdr2)¶

Compare two link layer addresses.

Return

True if the addresses are the same, false otherwise.

Parameters
  • lladdr1: Pointer to a link layer address

  • lladdr2: Pointer to a link layer address

static inline int net_linkaddr_set(struct net_linkaddr_storage *lladdr_store, uint8_t *new_addr, uint8_t new_len)¶

Set the member data of a link layer address storage structure.

Parameters
  • lladdr_store: The link address storage structure to change.

  • new_addr: Array of bytes containing the link address.

  • new_len: Length of the link address array. This value should always be <= NET_LINK_ADDR_MAX_LENGTH.

struct net_linkaddr¶
#include <net_linkaddr.h>

Hardware link address structure.

Used to hold the link address information

Public Members

uint8_t *addr¶

The array of byte representing the address

uint8_t len¶

Length of that address array

uint8_t type¶

What kind of address is this for

struct net_linkaddr_storage¶
#include <net_linkaddr.h>

Hardware link address structure.

Used to hold the link address information. This variant is needed when we have to store the link layer address.

Note that you cannot cast this to net_linkaddr as uint8_t * is handled differently than uint8_t addr[] and the fields are purposely in different order.

Public Members

uint8_t type¶

What kind of address is this for

uint8_t len¶

The real length of the ll address.

uint8_t addr[6]¶

The array of bytes representing the address

Next Previous

© Copyright 2015-2022 Zephyr Project members and individual contributors. Last updated on May 10, 2022.

Zephyr Project
ZCAN IOT SDK
ZCAN Xlib
MCUboot
SOF
Kconfig Reference