1 /* 2 ** Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved. 3 ** Copyright (C) 1998-2013 Sourcefire, Inc. 4 ** 5 ** This program is free software; you can redistribute it and/or modify 6 ** it under the terms of the GNU General Public License Version 2 as 7 ** published by the Free Software Foundation. You may not use, modify or 8 ** distribute this program under any other version of the GNU General 9 ** Public License. 10 ** 11 ** This program is distributed in the hope that it will be useful, 12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ** GNU General Public License for more details. 15 ** 16 ** You should have received a copy of the GNU General Public License 17 ** along with this program; if not, write to the Free Software 18 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 */ 20 21 /* 22 * Adam Keeton 23 * sf_vartable.h 24 * 11/17/06 25 * 26 * Library for implementing a variable table. 27 * All API calls have the prefix "sfvt". 28 */ 29 30 #ifndef SF_VARTABLE_H 31 #define SF_VARTABLE_H 32 33 #include "ipv6_port.h" 34 #include "sf_ipvar.h" 35 36 /* Allocates new variable table */ 37 vartable_t * sfvt_alloc_table(void); 38 void sfvt_free_table(vartable_t *table); 39 40 /* Adds the variable described by "str" to the table "table" */ 41 SFIP_RET sfvt_add_str(vartable_t *table, char *str, sfip_var_t **); 42 SFIP_RET sfvt_define(vartable_t *table, char *name, char *value); 43 44 /* Adds the variable described by "str" to the variable "dst", 45 * using the vartable for looking variables used within "str" */ 46 SFIP_RET sfvt_add_to_var(vartable_t *table, sfip_var_t *dst, char *src); 47 48 /* Looks up a variable from the table using the name as the key */ 49 sfip_var_t *sfvt_lookup_var(vartable_t *table, char *name); 50 51 /* Prints a table's contents */ 52 void sfvt_print(FILE *f, vartable_t *table); 53 54 #endif 55