2 * hostapd / VLAN definition
3 * Copyright (c) 2016, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 #include "utils/includes.h"
11 #include "utils/common.h"
14 /* compare the two arguments, NULL is treated as empty
15 * return zero iff they are equal
17 int vlan_compare(struct vlan_description *a, struct vlan_description *b)
20 const int a_empty = !a || !a->notempty;
21 const int b_empty = !b || !b->notempty;
23 if (a_empty && b_empty)
25 if (a_empty || b_empty)
27 if (a->untagged != b->untagged)
29 for (i = 0; i < MAX_NUM_TAGGED_VLAN; i++) {
30 if (a->tagged[i] != b->tagged[i])