#include "port-bonding.h"
#include "string.h"
-const struct nw_string_table nw_port_bonding_mode[] = {
+const nw_string_table_t nw_port_bonding_mode[] = {
{ NW_BONDING_MODE_ROUNDROBIN, "round-robin" },
{ NW_BONDING_MODE_ACTIVEBACKUP, "active-backup" },
{ NW_BONDING_MODE_XOR, "xor" },
#include "port-vlan.h"
#include "string.h"
-const struct nw_string_table nw_port_vlan_proto[] = {
+const nw_string_table_t nw_port_vlan_proto[] = {
{ NW_VLAN_PROTO_8021Q, "802.1Q" },
{ NW_VLAN_PROTO_8021ad, "802.1ad" },
{ -1, NULL },
Tables
*/
-struct nw_string_table {
+typedef struct nw_string_table {
const int id;
const char* string;
-};
+} nw_string_table_t;
static inline const char* nw_string_table_lookup_string(
- const struct nw_string_table* table, const int id) {
- const struct nw_string_table* entry = NULL;
+ const nw_string_table_t* table, const int id) {
+ const nw_string_table_t* entry = NULL;
for (entry = table; entry->string; entry++)
if (entry->id == id)
}
static inline int nw_string_table_lookup_id(
- const struct nw_string_table* table, const char* string) {
- const struct nw_string_table* entry = NULL;
+ const nw_string_table_t* table, const char* string) {
+ const nw_string_table_t* entry = NULL;
for (entry = table; entry->string; entry++)
if (strcmp(entry->string, string) == 0)