]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_flags.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IS-IS Rout(e)ing protocol - isis_flags.h
4 * Routines for manipulation of SSN and SRM flags
6 * Copyright (C) 2001,2002 Sampo Saaristo
7 * Tampere University of Technology
8 * Institute of Communications Engineering
11 #ifndef _ZEBRA_ISIS_FLAGS_H
12 #define _ZEBRA_ISIS_FLAGS_H
14 /* The grand plan is to support 1024 circuits so we have 32*32 bit flags
15 * the support will be achived using the newest drafts */
16 #define ISIS_MAX_CIRCUITS 32 /* = 1024 */
19 * Flags structure for SSN and SRM flags
23 struct list
*free_idcs
;
26 void flags_initialize(struct flags
*flags
);
27 long int flags_get_index(struct flags
*flags
);
28 void flags_free_index(struct flags
*flags
, long int index
);
29 int flags_any_set(uint32_t *flags
);
31 #define _ISIS_SET_FLAG(F, C) \
33 F[(C) >> 5] |= (1 << ((C)&0x1F)); \
35 #define ISIS_SET_FLAG(F, C) _ISIS_SET_FLAG(F, C->idx)
37 #define _ISIS_CLEAR_FLAG(F, C) \
39 F[(C) >> 5] &= ~(1 << ((C)&0x1F)); \
41 #define ISIS_CLEAR_FLAG(F, C) _ISIS_CLEAR_FLAG(F, C->idx)
43 #define _ISIS_CHECK_FLAG(F, C) (F[(C)>>5] & (1<<((C) & 0x1F)))
44 #define ISIS_CHECK_FLAG(F, C) _ISIS_CHECK_FLAG(F, C->idx)
46 /* sets all u_32int_t flags to 1 */
47 #define ISIS_FLAGS_SET_ALL(FLAGS) \
49 memset(FLAGS, 0xFF, ISIS_MAX_CIRCUITS * 4); \
52 #define ISIS_FLAGS_CLEAR_ALL(FLAGS) \
54 memset(FLAGS, 0x00, ISIS_MAX_CIRCUITS * 4); \
57 #endif /* _ZEBRA_ISIS_FLAGS_H */