summaryrefslogtreecommitdiff
path: root/src/cstore/cstore.hpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-11-04 18:34:30 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-11-04 18:34:30 -0700
commit1e1d0de703f3c7a7e1b6af0d984a736573759ad7 (patch)
tree00d5c4a7d801d1bcb6306beb961bfecd31b96596 /src/cstore/cstore.hpp
parentb979a051f8cf987edba889e812863260f73e8312 (diff)
downloadvyatta-cfg-1e1d0de703f3c7a7e1b6af0d984a736573759ad7.tar.gz
vyatta-cfg-1e1d0de703f3c7a7e1b6af0d984a736573759ad7.zip
add session assertion for API functions
* enforce session for API functions requiring it.
Diffstat (limited to 'src/cstore/cstore.hpp')
-rw-r--r--src/cstore/cstore.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cstore/cstore.hpp b/src/cstore/cstore.hpp
index e09c015..c7f179b 100644
--- a/src/cstore/cstore.hpp
+++ b/src/cstore/cstore.hpp
@@ -28,6 +28,14 @@
exit(-1); \
} while (0);
+#define ASSERT_IN_SESSION do \
+ { \
+ if (!inSession()) { \
+ exit_internal("no session\n"); \
+ } \
+ } while (0);
+
+
/* macros for saving/restoring paths.
* note: this allows "nested" save/restore invocations but NOT recursive ones.
*/