BIND 10 trac978, updated. 3eb8c8e08c993b1458a6d79f434e0305936bcd14 [trac978] The default action loader
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jun 15 10:16:00 UTC 2011
The branch, trac978 has been updated
via 3eb8c8e08c993b1458a6d79f434e0305936bcd14 (commit)
from 6fe98e3c2a669c9dc779980426a81fbe1ddcfff3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3eb8c8e08c993b1458a6d79f434e0305936bcd14
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Jun 15 12:15:47 2011 +0200
[trac978] The default action loader
-----------------------------------------------------------------------
Summary of changes:
src/lib/acl/loader.cc | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/acl/loader.cc b/src/lib/acl/loader.cc
index 6516d29..503d584 100644
--- a/src/lib/acl/loader.cc
+++ b/src/lib/acl/loader.cc
@@ -14,12 +14,32 @@
#include "loader.h"
+using namespace std;
+
namespace isc {
namespace acl {
-Action defaultActionLoader(data::ConstElementPtr) {
- // XXX: Temporary, so it compiles for now
- return (DROP);
+Action defaultActionLoader(data::ConstElementPtr actionEl) {
+ try {
+ const string action(actionEl->stringValue());
+ if (action == "ACCEPT") {
+ return (ACCEPT);
+ } else if (action == "REJECT") {
+ return (REJECT);
+ } else if (action == "DROP") {
+ return (DROP);
+ } else {
+ throw LoaderError(__FILE__, __LINE__,
+ string("Unknown action '" + action + "'").
+ c_str(),
+ actionEl);
+ }
+ }
+ catch (const data::TypeError&) {
+ throw LoaderError(__FILE__, __LINE__,
+ "Invalid element type for action, must be string",
+ actionEl);
+ }
}
}
More information about the bind10-changes
mailing list