Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 1 | How To Setup Apache Server |
| 2 | -------------------------- |
Radek Krejci | 8fd1f5e | 2012-07-24 17:33:36 +0200 | [diff] [blame] | 3 | - mod_netconf compilation requires apache2-devel and libjson-devel packages. |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 4 | |
| 5 | - run following commands in this directory |
| 6 | $ make |
| 7 | # make install |
| 8 | |
| 9 | - Add following lines into the (appropriate parts of the ) Apache configuration: |
| 10 | LoadModule netconf_module /usr/lib64/apache2/mod_netconf.so |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 11 | |
Radek Krejci | 8fd1f5e | 2012-07-24 17:33:36 +0200 | [diff] [blame] | 12 | - Start Apache |
| 13 | |
| 14 | - For testing, you can run test-client |
| 15 | - run under the same user as Apache, or change access rights of the |
| 16 | communication socket (/tmp/pconn.sock) to allow writing. |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 17 | |
| 18 | |
| 19 | mod_netconf Message Format |
| 20 | -------------------------- |
| 21 | |
| 22 | UNIX socket (with default path /tmp/mod_netconf.sock) is used for communication |
| 23 | with mod_netconf daemon. Messages are formated using JSON with the following |
| 24 | content. Client is free to send multiple requests when the communication socket |
| 25 | to the mod_netconf daemon is opened. |
| 26 | |
| 27 | Replies |
| 28 | ~~~~~~~ |
| 29 | 1) OK |
| 30 | key: type (int), value: 0 |
| 31 | |
| 32 | Optional (for request type 3 - create NETCONF connection): |
| 33 | key: session (string), value: 40 unique characters of session identifier |
| 34 | |
| 35 | 2) DATA |
| 36 | key: type (int), value: 1 |
| 37 | key: data (string) |
| 38 | |
| 39 | 3) ERROR |
| 40 | key: type (int), value: 2 |
| 41 | key: error-message (string) |
| 42 | |
| 43 | Optional: |
| 44 | key: error-tag (string) |
| 45 | key: error-type (string) |
| 46 | key: error-severity (string) |
Radek Krejci | b6aeb48 | 2012-07-26 11:04:25 +0200 | [diff] [blame] | 47 | key: error-app-tag (string) |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 48 | key: error-path (string) |
| 49 | key: bad-attribute (string) |
| 50 | key: bad-element (string) |
| 51 | key: bad-namespace (string) |
| 52 | key: session-id (string) |
| 53 | |
| 54 | Requests |
| 55 | ~~~~~~~~ |
| 56 | 1) Request to create NETCONF session |
| 57 | key: type (int), value: 3 |
| 58 | key: user (string) |
| 59 | key: pass (string), value: plain text password |
| 60 | |
| 61 | Optional: |
| 62 | key: host (string), "localhost" if not specified |
| 63 | key: port (string), "830" if not specified |
| 64 | |
| 65 | 2) Request to close NETCONF session |
| 66 | key: type (int), value: 4 |
| 67 | key: session (string), value: unique session identifier |
| 68 | |
| 69 | 3) NETCONF <get> |
| 70 | key: type (int), value: 5 |
| 71 | key: session (string), value: unique session identifier |
| 72 | |
| 73 | Optional: |
| 74 | key: filter (string), value: xml subtree filter |
| 75 | |
| 76 | 4) NETCONF <get-config> |
| 77 | key: type (int), value: 6 |
| 78 | key: session (string), value: unique session identifier |
| 79 | key: source (string), value: running|startup|candidate |
| 80 | |
| 81 | Optional: |
| 82 | key: filter (string), value: xml subtree filter |
| 83 | |
| 84 | 5) NETCONF <edit-config> |
| 85 | key: type (int), value: 7 |
| 86 | key: session (string), value: unique session identifier |
| 87 | key: target (string), value: running|startup|candidate |
| 88 | key: config (string), value: editing configuration data according to NETCONF RFC |
| 89 | |
| 90 | Optional: |
| 91 | key: default-operation (string), value: merge|replace|none |
| 92 | key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error |
| 93 | |
| 94 | 6) NETCONF <copy-config> |
| 95 | key: type (int), value: 8 |
| 96 | key: session (string), value: unique session identifier |
| 97 | key: target (string), value: running|startup|candidate |
| 98 | |
| 99 | Alternating: |
| 100 | key: source (string), value: running|startup|candidate |
| 101 | key: config (string), value: new complete configuration data, if source not specified |
| 102 | |
| 103 | 7) NETCONF <delete-config> |
| 104 | key: type (int), value: 9 |
| 105 | key: session (string), value: unique session identifier |
| 106 | key: target (string), value: running|startup|candidate |
| 107 | |
| 108 | 8) NETCONF <lock> |
| 109 | key: type (int), value: 10 |
| 110 | key: session (string), value: unique session identifier |
| 111 | key: target (string), value: running|startup|candidate |
| 112 | |
| 113 | 9) NETCONF <unlock> |
| 114 | key: type (int), value: 11 |
| 115 | key: session (string), value: unique session identifier |
| 116 | key: target (string), value: running|startup|candidate |
| 117 | |
| 118 | 10) NETCONF <kill-session> |
| 119 | key: type (int), value: 12 |
| 120 | key: session (string), value: unique session identifier |
| 121 | key: session-id (string), value: ID of the session to kill |
| 122 | |
| 123 | |