|
@@ -1,4 +1,4 @@
|
|
|
-1. prefix_route Module
|
|
|
+prefix_route Module
|
|
|
|
|
|
Alfred E. Heggestad
|
|
|
|
|
@@ -9,25 +9,15 @@ Alfred E. Heggestad
|
|
|
Copyright © 2008 Telio Telecom AS
|
|
|
__________________________________________________________________
|
|
|
|
|
|
- 1.1. Overview
|
|
|
- 1.2. Parameters
|
|
|
+ List of Examples
|
|
|
|
|
|
- 1.2.1. db_url (string)
|
|
|
- 1.2.2. db_table (string)
|
|
|
- 1.2.3. exit (int)
|
|
|
+ 1. Setting db_url parameter
|
|
|
+ 2. Setting db_table parameter
|
|
|
+ 3. Setting exit parameter
|
|
|
+ 4. prefix_route() usage
|
|
|
+ 5. Sample data
|
|
|
|
|
|
- 1.3. Functions
|
|
|
-
|
|
|
- 1.3.1. prefix_route([user])
|
|
|
-
|
|
|
- 1.4. RPC Commands
|
|
|
-
|
|
|
- 1.4.1. prefix_route.reload
|
|
|
- 1.4.2. prefix_route.dump
|
|
|
-
|
|
|
- 1.5. Database Structure
|
|
|
-
|
|
|
-1.1. Overview
|
|
|
+1. Overview
|
|
|
|
|
|
The prefix_route module does routing based on a set of prefixes from
|
|
|
the database. The prefix rule-set is loaded from the database into a
|
|
@@ -40,9 +30,13 @@ Alfred E. Heggestad
|
|
|
|
|
|
Development was sponsored by Telio Telecom.
|
|
|
|
|
|
-1.2. Parameters
|
|
|
+2. Parameters
|
|
|
+
|
|
|
+ 2.1. db_url (string)
|
|
|
+ 2.2. db_table (string)
|
|
|
+ 2.3. exit (int)
|
|
|
|
|
|
-1.2.1. db_url (string)
|
|
|
+2.1. db_url (string)
|
|
|
|
|
|
This is URL of the database to be used.
|
|
|
|
|
@@ -53,7 +47,7 @@ Alfred E. Heggestad
|
|
|
modparam("prefix_route", "db_url", "mysql://ser:pass@db_host/ser")
|
|
|
...
|
|
|
|
|
|
-1.2.2. db_table (string)
|
|
|
+2.2. db_table (string)
|
|
|
|
|
|
The name of table where to read prefix route set.
|
|
|
|
|
@@ -64,7 +58,7 @@ modparam("prefix_route", "db_url", "mysql://ser:pass@db_host/ser")
|
|
|
modparam("prefix_route", "db_table", "new_prefix_route")
|
|
|
...
|
|
|
|
|
|
-1.2.3. exit (int)
|
|
|
+2.3. exit (int)
|
|
|
|
|
|
If set, exit the execution of the configuration file when a route block
|
|
|
is executed upon matching a prefix. Otherwise return 1 (true).
|
|
@@ -76,9 +70,11 @@ modparam("prefix_route", "db_table", "new_prefix_route")
|
|
|
modparam("prefix_route", "exit", 0)
|
|
|
...
|
|
|
|
|
|
-1.3. Functions
|
|
|
+3. Functions
|
|
|
|
|
|
-1.3.1. prefix_route([user])
|
|
|
+ 3.1. prefix_route([user])
|
|
|
+
|
|
|
+3.1. prefix_route([user])
|
|
|
|
|
|
This function tries to find a route from the user part of the request
|
|
|
URI (if no parameter is provided), or from the value of the parameter.
|
|
@@ -99,18 +95,21 @@ modparam("prefix_route", "exit", 0)
|
|
|
|
|
|
...
|
|
|
|
|
|
-1.4. RPC Commands
|
|
|
+4. RPC Commands
|
|
|
+
|
|
|
+ 4.1. prefix_route.reload
|
|
|
+ 4.2. prefix_route.dump
|
|
|
|
|
|
-1.4.1. prefix_route.reload
|
|
|
+4.1. prefix_route.reload
|
|
|
|
|
|
Reload prefix route tree from the database. Validation is done and the
|
|
|
prefix route tree will only be reloaded if there are no errors.
|
|
|
|
|
|
-1.4.2. prefix_route.dump
|
|
|
+4.2. prefix_route.dump
|
|
|
|
|
|
Dump the current prefix route tree.
|
|
|
|
|
|
-1.5. Database Structure
|
|
|
+5. Database Structure
|
|
|
|
|
|
A prefix route set consists of three fields:
|
|
|
* prefix - varchar(64) - Prefix rule
|