mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-27 18:47:13 +08:00
Add macro ETH_ADDR() to initialize a struct eth_addr with its 6 bytes and taking care of correct braces
This commit is contained in:
@@ -55,6 +55,7 @@ extern "C" {
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
/** An Ethernet MAC address */
|
||||
struct eth_addr {
|
||||
PACK_STRUCT_FLD_8(u8_t addr[ETH_HWADDR_LEN]);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
@@ -63,6 +64,9 @@ PACK_STRUCT_END
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/** Initialize a struct eth_addr with its 6 bytes (takes care of correct braces) */
|
||||
#define ETH_ADDR(b0, b1, b2, b3, b4, b5) {{b0, b1, b2, b3, b4, b5}}
|
||||
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ typedef struct bridgeif_initdata_s {
|
||||
|
||||
/** @ingroup bridgeif
|
||||
* Use this for constant initialization of a bridgeif_initdat_t
|
||||
* (ethaddr must be passed as MAKE_ETH_ADDR())
|
||||
* (ethaddr must be passed as ETH_ADDR())
|
||||
*/
|
||||
#define BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr) {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries}
|
||||
/** @ingroup bridgeif
|
||||
|
||||
Reference in New Issue
Block a user