l2scan_list.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2023 ML!PA Consulting Gmbh
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdlib.h>
22 
23 #include "list.h"
24 #include "net/netopt.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 typedef struct l2scan_list {
35  /* items */
37 
47  list_node_t *nodes, unsigned nodes_numof,
48  size_t node_size);
49 
60  list_node_t *nodes, unsigned nodes_numof,
61  size_t node_size,
62  const netopt_scan_result_t *result);
63 
74 unsigned l2scan_list_to_array(const l2scan_list_t *list,
75  void *nodes_array, unsigned nodes_numof,
76  size_t node_size);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
unsigned l2scan_list_to_array(const l2scan_list_t *list, void *nodes_array, unsigned nodes_numof, size_t node_size)
Copy the content of a L2 scan list to an array to get rid of the list overhead.
struct l2scan_list l2scan_list_t
Type of a Link Layer scan list.
void l2scan_list_empty(l2scan_list_t *list, list_node_t *nodes, unsigned nodes_numof, size_t node_size)
Empty the list to start a new scan.
void l2scan_list_insert(l2scan_list_t *list, list_node_t *nodes, unsigned nodes_numof, size_t node_size, const netopt_scan_result_t *result)
Insert a new scan result into the list.
Intrusive linked list.
Definition of global configuration options.
Type of a Link Layer scan list.
Definition: l2scan_list.h:33
list_node_t head
List head, where head->next is the first element.
Definition: l2scan_list.h:34
List node structure.
Definition: list.h:36
Basic network scan result.
Definition: netopt.h:938