Debian Codegraph @

common/rommon_var.h

raw
1 /*
2 * Cisco router simulation platform.
3 * Copyright (c) 2007 Christophe Fillot ([email protected])
4 *
5 * ROMMON Environment Variables.
6 */
7
8 #ifndef __ROMMON_VAR_H__
9 #define __ROMMON_VAR_H__
10
11 #include "dynamips_common.h"
12
13 /* ROMMON variable */
14 struct rommon_var {
15 struct rommon_var *next;
16 char *name;
17 char *value;
18 };
19
20 /* List of ROMMON variables */
21 struct rommon_var_list {
22 char *filename;
23 struct rommon_var *var_list;
24 };
25
26 /* Load file containing ROMMON variables */
27 int rommon_load_file(struct rommon_var_list *rvl);
28
29 /* Add a new variable */
30 int rommon_var_add(struct rommon_var_list *rvl,char *name,char *value);
31
32 /*
33 * Add a new variable, specified at the format: var=value.
34 * The string is modified.
35 */
36 int rommon_var_add_str(struct rommon_var_list *rvl,char *str);
37
38 /* Get the specified variable */
39 int rommon_var_get(struct rommon_var_list *rvl,char *name,
40 char *buffer,size_t len);
41
42 /* Clear all the variables */
43 void rommon_var_clear(struct rommon_var_list *rvl);
44
45 #endif
46