]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_flags.h
2 * IS-IS Rout(e)ing protocol - isis_flags.h
3 * Routines for manipulation of SSN and SRM flags
5 * Copyright (C) 2001,2002 Sampo Saaristo
6 * Tampere University of Technology
7 * Institute of Communications Engineering
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public Licenseas published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
14 * This program is distributed in the hope that it will be useful,but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * You should have received a copy of the GNU General Public License along
20 * with this program; see the file COPYING; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef _ZEBRA_ISIS_FLAGS_H
25 #define _ZEBRA_ISIS_FLAGS_H
27 /* The grand plan is to support 1024 circuits so we have 32*32 bit flags
28 * the support will be achived using the newest drafts */
29 #define ISIS_MAX_CIRCUITS 32 /* = 1024 */
32 * Flags structure for SSN and SRM flags
36 struct list
*free_idcs
;
39 void flags_initialize(struct flags
*flags
);
40 long int flags_get_index(struct flags
*flags
);
41 void flags_free_index(struct flags
*flags
, long int index
);
42 int flags_any_set(uint32_t *flags
);
44 #define _ISIS_SET_FLAG(F, C) \
46 F[(C) >> 5] |= (1 << ((C)&0x1F)); \
48 #define ISIS_SET_FLAG(F, C) _ISIS_SET_FLAG(F, C->idx)
50 #define _ISIS_CLEAR_FLAG(F, C) \
52 F[(C) >> 5] &= ~(1 << ((C)&0x1F)); \
54 #define ISIS_CLEAR_FLAG(F, C) _ISIS_CLEAR_FLAG(F, C->idx)
56 #define _ISIS_CHECK_FLAG(F, C) (F[(C)>>5] & (1<<((C) & 0x1F)))
57 #define ISIS_CHECK_FLAG(F, C) _ISIS_CHECK_FLAG(F, C->idx)
59 /* sets all u_32int_t flags to 1 */
60 #define ISIS_FLAGS_SET_ALL(FLAGS) \
62 memset(FLAGS, 0xFF, ISIS_MAX_CIRCUITS * 4); \
65 #define ISIS_FLAGS_CLEAR_ALL(FLAGS) \
67 memset(FLAGS, 0x00, ISIS_MAX_CIRCUITS * 4); \
70 #endif /* _ZEBRA_ISIS_FLAGS_H */