]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
remote setup.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 12 Sep 2008 13:01:20 +0000 (13:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 12 Sep 2008 13:01:20 +0000 (13:01 +0000)
git-svn-id: file:///svn/unbound/trunk@1234 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
doc/control_proto_spec.txt
smallapp/unbound-control.c

index 714ae0108577c031367507a8a13d948494968196..8e8cc18ee759213305db692560a6a71f5727a391 100644 (file)
@@ -382,8 +382,7 @@ clean_point(struct daemon_remote* rc, struct rc_state* s)
 static void
 handle_req(struct daemon_remote* rc, struct rc_state* s, SSL* ssl)
 {
-       char* msg = "HTTP/1.0 200 OK\r\nContent-type: text/plain\r\n\r\n"
-               "unbound server control channel\n";
+       char* msg = "ok\n";
        int r;
        char buf[1024];
        fd_set_block(s->c->fd);
index d57c7aa4f42ed43b5c161bd62f5a33e2f1995099..cf9078622cdc6d6b994cd409dc3bef610ba689ef 100644 (file)
@@ -16,23 +16,25 @@ Server executes command. And sends reply in ascii text over channel,
 closes the channel when done.
        in case of error the first line of the response is:
                error <descriptive text possible> \n
-       or the remainder is data of the response.
+       or the remainder is data of the response, for many commands the 
+       response is 'ok\n'.
 
 Queries and responses
 ---------------------
 stop
-       no output
+       stops the server.
 reload
-       no output
+       reloads the config file, and flushes the cache.
 stats
        output is a list of [name]=[value] lines.
        clears the counters.
 dump_cache
        output is a text representation of the cache contents.
+       data ends with a line 'EOF' before connection close.
 load_cache
-       client sends cache contents (like from dump_cache), stored in the
-       cache. If client sends 'ok' or 'error' lines at start, ignored.
-       end of data indicated with a line with 'EOF' on it.
+       client sends cache contents (like from dump_cache), which is stored 
+       in the cache. end of data indicated with a line with 'EOF' on it.
+       The data is sent after the query line.
 flush_name <name>
        flushes some information regarding the name from the cache.
        removes the A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR types.
@@ -41,20 +43,25 @@ flush_type <name> <RR type>
 flush_zone <name>
        removes name and everything below that name from the cache.
        has to search through the cache item by item, so this is slow.
-delegation <domain name>
-       see what servers would be queried for the given domain name.
-info <domain name>
-       see data about the domain name
+delegation <name>
+       see what servers would be queried for the given name.
+info <name>
+       see data about the name. Slow, searches the cache item by item.
 local_zone_remove <name of local-zone entry>
        the local-zone entry is removed.
        All data from the local zone is also deleted.
        If it did not exist, nothing happens.
-local_zone_add <name of local zone> <type>
+local_zone <name of local zone> <type>
        As the config file entry. Adds new local zone or updates
        existing zone type.
 local_data_remove <name>
        Removes local-data (all types) name.
-local_data_add <resource record string>
+local_data <resource record string>
        Add new local data record (on the rest of the line).
        local_data_add www.example.com. IN A 192.0.2.2
+       if no local_zone exists for it; a transparent zone with the same
+       name as the data is created.
+verbosity <new value>
+       Change logging verbosity to new value.
+
 
index 98a03c4bf0d2b95ca8e52b61bf7c69c222c652ea..59e8f9aa654f3bf1716388a33a848cc0b64fe384 100644 (file)
@@ -187,9 +187,20 @@ static void
 go_cmd(SSL* ssl, int argc, char* argv[])
 {
        char* cmd = "GET / HTTP/1.0\n\n";
-       int r;
+       char* pre="UBCT";
+       char* space=" ";
+       char* newline="\n";
+       int r, i;
        char buf[1024];
-       if(SSL_write(ssl, cmd, (int)strlen(cmd)) <= 0)
+       if(SSL_write(ssl, pre, (int)strlen(pre)) <= 0)
+               ssl_err("could not SSL_write");
+       for(i=0; i<argc; i++) {
+               if(SSL_write(ssl, space, (int)strlen(space)) <= 0)
+                       ssl_err("could not SSL_write");
+               if(SSL_write(ssl, argv[i], (int)strlen(argv[i])) <= 0)
+                       ssl_err("could not SSL_write");
+       }
+       if(SSL_write(ssl, newline, (int)strlen(newline)) <= 0)
                ssl_err("could not SSL_write");
        while(1) {
                ERR_clear_error();