"Fossies" - the Fresh Open Source Software archive

Member "open-fcoe/usr/common/libsa/include/sa_nameval.h" of archive open-fcoe.tar.gz:


/*
 * Copyright(c) 2007 Intel Corporation. All rights reserved.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 * 
 * This program is distributed in the hope 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; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 * 
 * Maintained at www.Open-FCoE.org
 */

#ifndef _LIBSA_NAMEVAL_H_
#define _LIBSA_NAMEVAL_H_

/*
 * Structure for tables encoding and decoding name-value pairs such as enums.
 */
struct sa_nameval {
    char    *nv_name;
    u_int   nv_val;
};

const char *sa_enum_decode(char *, size_t, const struct sa_nameval *, u_int);
int sa_enum_encode(const struct sa_nameval *tp, const char *, u_int *);
const char * sa_flags_decode(char *, size_t, const struct sa_nameval *, u_int);

#endif /* _LIBSA_NAMEVAL_H_ */