1N/A/************************************************************************
1N/A * RSTP library - Rapid Spanning Tree (802.1t, 802.1w)
1N/A * Copyright (C) 2001-2003 Optical Access
1N/A * Author: Alex Rozin
1N/A *
1N/A * This file is part of RSTP library.
1N/A *
1N/A * RSTP library is free software; you can redistribute it and/or modify it
1N/A * under the terms of the GNU Lesser General Public License as published by the
1N/A * Free Software Foundation; version 2.1
1N/A *
1N/A * RSTP library is distributed in the hope that it will be useful, but
1N/A * WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
1N/A * General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU Lesser General Public License
1N/A * along with RSTP library; see the file COPYING. If not, write to the Free
1N/A * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1N/A * 02111-1307, USA.
1N/A **********************************************************************/
1N/A
1N/A#ifndef _STP_CHOOSE_H__
1N/A#define _STP_CHOOSE_H__
1N/A
1N/A/* State machines states & debug tools. Sorry, if these are no readable enogth :( */
1N/A
1N/A#define CHOOSE(a) a
1N/Atypedef enum STATES THE_STATE_T;
1N/A#undef CHOOSE
1N/A
1N/Achar * GET_STATE_NAME (int state)
1N/A{
1N/A#define CHOOSE(a) #a
1N/Astatic char *state_names[] = STATES;
1N/A#undef CHOOSE
1N/A
1N/A if (BEGIN == state) return "Begin";
1N/A return state_names[state];
1N/A}
1N/A
1N/A#endif /* _STP_CHOOSE_H__ */