2 *------------------------------------------------------------------
3 * svmdb.h - shared VM database
5 * Copyright (c) 2009 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *------------------------------------------------------------------
20 #ifndef __included_svmdb_h__
21 #define __included_svmdb_h__
26 SVMDB_ACTION_ILLEGAL=0,
27 SVMDB_ACTION_GET, /* not clear why anyone would care */
41 svmdb_notify_t *notifications;
46 SVMDB_NAMESPACE_STRING=0,
54 svmdb_value_t *values;
55 uword *namespaces [SVMDB_N_NAMESPACES];
58 #define SVMDB_SHM_VERSION 2
69 svmdb_namespace_t nspace;
75 } svmdb_notification_args_t;
78 * Must be a reasonable number, several mb smaller than
79 * SVM_GLOBAL_REGION_SIZE, or no donut for you...
81 #define SVMDB_DEFAULT_SIZE (4<<20)
83 svmdb_client_t *svmdb_map (void);
85 svmdb_client_t *svmdb_map_size (uword size);
87 svmdb_client_t *svmdb_map_chroot (char *root_path);
89 svmdb_client_t *svmdb_map_chroot_size (char *root_path, uword size);
91 void svmdb_unmap (svmdb_client_t *client);
92 void svmdb_local_unset_string_variable (svmdb_client_t *client, char *var);
93 void svmdb_local_set_string_variable (svmdb_client_t *client,
94 char *var, char *val);
95 char *svmdb_local_get_string_variable (svmdb_client_t *client, char *var);
96 void *svmdb_local_get_variable_reference (svmdb_client_t *client,
100 void svmdb_local_dump_strings (svmdb_client_t *client);
102 void svmdb_local_unset_vec_variable (svmdb_client_t *client, char *var);
103 void svmdb_local_set_vec_variable (svmdb_client_t *client,
104 char *var, void *val, u32 elsize);
105 void *svmdb_local_get_vec_variable (svmdb_client_t *client, char *var,
107 void svmdb_local_dump_vecs (svmdb_client_t *client);
109 int svmdb_local_add_del_notification (svmdb_client_t *client,
110 svmdb_notification_args_t *args);
112 void *svmdb_local_find_or_add_vec_variable (svmdb_client_t *client,
113 char *var, u32 nbytes);
115 #endif /* __included_svmdb_h__ */