a210692525
This makes most header files easier to look at. Also Emacs gets really slow when browsing through large sections of overly long prototypes, which is much improved by this macro. We should probably not do something similar with too many other cases, as macros like this might help readability for some, but make it worse for others. But I think given the complexity of this specific prototype and how often we use it, it's worth doing.
27 lines
591 B
C
27 lines
591 B
C
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
#pragma once
|
|
|
|
/***
|
|
This file is part of systemd.
|
|
|
|
Copyright 2016 Lennart Poettering
|
|
***/
|
|
|
|
#include <stdbool.h>
|
|
#include <inttypes.h>
|
|
|
|
#include "conf-parser.h"
|
|
|
|
#define VLANID_MAX 4094
|
|
#define VLANID_INVALID UINT16_MAX
|
|
|
|
/* Note that we permit VLAN Id 0 here, as that is apparently OK by the Linux kernel */
|
|
static inline bool vlanid_is_valid(uint16_t id) {
|
|
return id <= VLANID_MAX;
|
|
}
|
|
|
|
int parse_vlanid(const char *p, uint16_t *ret);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_default_port_vlanid);
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_vlanid);
|