Loading...
Searching...
No Matches
notify.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 TU Dresden
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
32
33#include <stdint.h>
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include "net/gnrc/netif/conf.h"
39#include "sema_inv.h"
40
54
64
74
80static inline void gnrc_netapi_notify_ack(sema_inv_t *ack)
81{
82 sema_inv_post(ack);
83}
84
98int gnrc_netapi_notify_copy_event_data(gnrc_netapi_notify_t *notify, uint8_t data_len, void *data);
99
100#ifdef __cplusplus
101}
102#endif
103
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:135
static void gnrc_netapi_notify_ack(sema_inv_t *ack)
Acknowledge that a notify event was received and its data read.
Definition notify.h:80
int gnrc_netapi_notify_copy_event_data(gnrc_netapi_notify_t *notify, uint8_t data_len, void *data)
Copy the connection event data associated with a gnrc_netapi_notify_t event.
netapi_notify_t
Definition of notification event types in the network stack.
Definition notify.h:48
@ NETAPI_NOTIFY_L3_UNREACHABLE
Node became unreachable on the network layer.
Definition notify.h:52
@ NETAPI_NOTIFY_L2_NEIGH_CONNECTED
Connection established on layer 2.
Definition notify.h:49
@ NETAPI_NOTIFY_L3_DISCOVERED
Discovered node on the network layer.
Definition notify.h:51
@ NETAPI_NOTIFY_L2_NEIGH_DISCONNECTED
Connection closed on layer 2.
Definition notify.h:50
#define GNRC_NETIF_L2ADDR_MAXLEN
Maximum length of the link-layer address.
Definition conf.h:158
bool sema_inv_post(sema_inv_t *s)
Signal semaphore (counter mode).
Configuration macros for Network interface API.
Inverse Semaphore definitions.
Data structure to be sent for netapi notification events.
Definition notify.h:58
uint16_t _data_len
size of the event data
Definition notify.h:61
sema_inv_t ack
inverse semaphore for collecting ack's
Definition notify.h:62
netapi_notify_t event
the type of event
Definition notify.h:59
void * _data
associated event data.
Definition notify.h:60
L2 connection event data associated with NETAPI_NOTIFY_L2_NEIGH_CONNECTED or NETAPI_NOTIFY_L2_NEIGH_D...
Definition notify.h:69
uint8_t l2addr_len
length of L2 address in byte
Definition notify.h:71
uint8_t l2addr[GNRC_NETIF_L2ADDR_MAXLEN]
L2 address of the node.
Definition notify.h:70
kernel_pid_t if_pid
PID of network interface.
Definition notify.h:72
An Inverse Semaphore.
Definition sema_inv.h:58