Registry to receive messages of a specified protocol type by GNRC.
More...
Registry to receive messages of a specified protocol type by GNRC.
◆ GNRC_NETREG_DEMUX_CTX_ALL
#define GNRC_NETREG_DEMUX_CTX_ALL (0xffff0000) |
◆ GNRC_NETREG_ENTRY_INIT_CB
#define GNRC_NETREG_ENTRY_INIT_CB |
( |
|
demux_ctx, |
|
|
|
_cbd |
|
) |
| |
Value: { NULL, demux_ctx, \
GNRC_NETREG_TYPE_CB, \
{ .cbd = _cbd } }
Initializes a netreg entry statically with callback.
- Parameters
-
[in] | demux_ctx | The demux context for the netreg entry |
[in] | _cbd | Target callback for the registry entry |
- Note
- Only available with Callback extension.
- Returns
- An initialized netreg entry
Definition at line 133 of file netreg.h.
◆ GNRC_NETREG_ENTRY_INIT_MBOX
#define GNRC_NETREG_ENTRY_INIT_MBOX |
( |
|
demux_ctx, |
|
|
|
_mbox |
|
) |
| |
Value: { NULL, demux_ctx, \
GNRC_NETREG_TYPE_MBOX, \
{ .mbox = _mbox } }
Initializes a netreg entry statically with mbox.
- Parameters
-
- Note
- Only available with Mailbox IPC extension.
- Returns
- An initialized netreg entry
Definition at line 116 of file netreg.h.
◆ GNRC_NETREG_ENTRY_INIT_PID
#define GNRC_NETREG_ENTRY_INIT_PID |
( |
|
demux_ctx, |
|
|
|
pid |
|
) |
| { NULL, demux_ctx, { pid } } |
Initializes a netreg entry statically with PID.
- Parameters
-
[in] | demux_ctx | The demux context for the netreg entry |
[in] | pid | The PID of the registering thread |
- Returns
- An initialized netreg entry
Definition at line 101 of file netreg.h.
◆ gnrc_netreg_entry_cb_t
typedef void(* gnrc_netreg_entry_cb_t) (uint16_t cmd, gnrc_pktsnip_t *pkt, void *ctx) |
◆ gnrc_netreg_type_t
The type of the netreg entry.
Different types are available dependent on the used modules.
Enumerator |
---|
GNRC_NETREG_TYPE_DEFAULT | Use default IPC for netapi operations.
- Note
- Implicitly chosen without
gnrc_netapi_mbox and gnrc_netapi_callbacks modules.
|
GNRC_NETREG_TYPE_MBOX | Use centralized IPC for netapi operations.
- Note
- Only available with
gnrc_netapi_mbox module.
|
GNRC_NETREG_TYPE_CB | Use function callbacks for netapi operations.
- Note
- Only available with
gnrc_netapi_callbacks module.
|
Definition at line 45 of file netreg.h.
◆ gnrc_netreg_calc_csum()
Calculates the checksum for a header.
- Parameters
-
[in] | hdr | The header the checksum should be calculated for. |
[in] | pseudo_hdr | The header the pseudo header shall be generated from. NULL if none is needed. |
- Returns
- 0, on success.
-
-EINVAL, if
pseudo_hdr
is NULL but a pseudo header was required.
-
-ENOENT, if Network protocol registry does not know how to calculate checksum for gnrc_pktsnip_t::type of
hdr
.
◆ gnrc_netreg_entry_init_cb()
Initializes a netreg entry dynamically with callback.
- Parameters
-
[out] | entry | A netreg entry |
[in] | demux_ctx | The demux context for the netreg entry |
[in] | cbd | Target callback for the registry entry |
- Note
- Only available with Callback extension.
Definition at line 279 of file netreg.h.
◆ gnrc_netreg_entry_init_mbox()
Initializes a netreg entry dynamically with mbox.
- Parameters
-
[out] | entry | A netreg entry |
[in] | demux_ctx | The demux context for the netreg entry |
[in] | mbox | Target mailbox for the registry entry |
- Note
- Only available with Mailbox IPC extension.
Definition at line 257 of file netreg.h.
◆ gnrc_netreg_entry_init_pid()
Initializes a netreg entry dynamically with PID.
- Parameters
-
[out] | entry | A netreg entry |
[in] | demux_ctx | The demux context for the netreg entry |
[in] | pid | The PID of the registering thread |
Definition at line 234 of file netreg.h.
◆ gnrc_netreg_getnext()
◆ gnrc_netreg_lookup()
Searches for entries with given parameters in the registry and returns the first found.
- Parameters
-
- Returns
- The first entry fitting the given parameters on success
-
NULL if no entry can be found.
◆ gnrc_netreg_num()
◆ gnrc_netreg_register()
◆ gnrc_netreg_unregister()
Removes a thread from the registry.
- Parameters
-
[in] | type | Type of the protocol. |
[in] | entry | An entry you want to remove from the registry. |