| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "conf-parser-forward.h" |
| 5 |
#include "shared-forward.h" |
| 6 |
|
| 7 |
#define VLANID_MAX 4094 |
| 8 |
#define VLANID_INVALID UINT16_MAX |
| 9 |
|
| 10 |
/* Note that we permit VLAN ID 0 here, as that is apparently OK by the Linux kernel */ |
| 11 |
static inline bool vlanid_is_valid(uint16_t id) { |
| 12 |
return id <= VLANID_MAX; |
| 13 |
} |
| 14 |
|
| 15 |
int parse_vlanid(const char *p, uint16_t *ret); |
| 16 |
int parse_vid_range(const char *p, uint16_t *vid, uint16_t *vid_end); |
| 17 |
|
| 18 |
CONFIG_PARSER_PROTOTYPE(config_parse_default_port_vlanid); |
| 19 |
CONFIG_PARSER_PROTOTYPE(config_parse_vlanid); |