diff options
author | Olivier Dugeon <olivier.dugeon@orange.com> | 2023-01-26 17:44:00 +0100 |
---|---|---|
committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2023-03-21 15:19:09 +0100 |
commit | 7f9ab3b0bbd8c4b81b839872b02efbd11f6c67b0 (patch) | |
tree | 46b56885289d915393bb83d8a3628a84e7771bc7 /lib/iso.h | |
parent | Merge pull request #12816 from gpnaveen/stc_rte_err_msg (diff) | |
download | frr-7f9ab3b0bbd8c4b81b839872b02efbd11f6c67b0.tar.xz frr-7f9ab3b0bbd8c4b81b839872b02efbd11f6c67b0.zip |
lib: Add ISO System & Network format to printfrr
Like for IP addresses, this patch add a new format for printfrr collection to
print ISO System ID and Network address a.k.a IS-IS system ID & Network.
This new format is added to the library instead of isisd because other daemons
and tools need to print ISO System ID & Network Address.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'lib/iso.h')
-rw-r--r-- | lib/iso.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/iso.h b/lib/iso.h new file mode 100644 index 000000000..975d3c154 --- /dev/null +++ b/lib/iso.h @@ -0,0 +1,49 @@ +/* + * ISO Network definition - iso_net.h + * + * Author: Olivier Dugeon <olivier.dugeon@orange.com> + * + * Copyright (C) 2023 Orange http://www.orange.com + * + * This file is part of Free Range Routing (FRR). + * + * FRR is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * FRR is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIB_ISO_H_ +#define LIB_ISO_H_ + +#include "compiler.h" + +/* len of "xx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xx" + '\0' */ +#define ISO_ADDR_STRLEN 51 +#define ISO_ADDR_MIN 8 +#define ISO_ADDR_SIZE 20 +struct iso_address { + uint8_t addr_len; + uint8_t area_addr[ISO_ADDR_SIZE]; +}; + +/* len of "xxxx.xxxx.xxxx.xx-xx" + '\0' */ +#define ISO_SYSID_STRLEN 21 + +#ifdef _FRR_ATTRIBUTE_PRINTFRR +#pragma FRR printfrr_ext "%pSY" (uint8_t *) +#pragma FRR printfrr_ext "%pPN" (uint8_t *) +#pragma FRR printfrr_ext "%pLS" (uint8_t *) +#pragma FRR printfrr_ext "%pIS" (struct iso_address *) +#endif + +#endif /* LIB_ISO_H_ */ |