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 "compiler_hints.h"
39#include "net/gnrc/netif/conf.h"
40#include "sema_inv.h"
41
55
65
75
81static inline void gnrc_netapi_notify_ack(sema_inv_t *ack)
82{
83 sema_inv_post(ack);
84}
85
99ACCESS(write_only, 3, 2)
100int gnrc_netapi_notify_copy_event_data(gnrc_netapi_notify_t *notify, uint8_t data_len, void *data);
101
102#ifdef __cplusplus
103}
104#endif
105
Common macros and compiler attributes/pragmas configuration.
#define ACCESS(mode, ptr_idx, size_idx)
Emit an attribute (if supported by the compiler) that declares how a function will access its paramet...
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:134
static void gnrc_netapi_notify_ack(sema_inv_t *ack)
Acknowledge that a notify event was received and its data read.
Definition notify.h:81
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:49
@ NETAPI_NOTIFY_L3_UNREACHABLE
Node became unreachable on the network layer.
Definition notify.h:53
@ NETAPI_NOTIFY_L2_NEIGH_CONNECTED
Connection established on layer 2.
Definition notify.h:50
@ NETAPI_NOTIFY_L3_DISCOVERED
Discovered node on the network layer.
Definition notify.h:52
@ NETAPI_NOTIFY_L2_NEIGH_DISCONNECTED
Connection closed on layer 2.
Definition notify.h:51
#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:59
uint16_t _data_len
size of the event data
Definition notify.h:62
sema_inv_t ack
inverse semaphore for collecting ack's
Definition notify.h:63
netapi_notify_t event
the type of event
Definition notify.h:60
void * _data
associated event data.
Definition notify.h:61
L2 connection event data associated with NETAPI_NOTIFY_L2_NEIGH_CONNECTED or NETAPI_NOTIFY_L2_NEIGH_D...
Definition notify.h:70
uint8_t l2addr_len
length of L2 address in byte
Definition notify.h:72
uint8_t l2addr[GNRC_NETIF_L2ADDR_MAXLEN]
L2 address of the node.
Definition notify.h:71
kernel_pid_t if_pid
PID of network interface.
Definition notify.h:73
An Inverse Semaphore.
Definition sema_inv.h:58