commotiond - an embedded C daemon for managing mesh networks. More...
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <limits.h>
#include "config.h"
#include "debug.h"
#include "cmd.h"
#include "util.h"
#include "loop.h"
#include "plugin.h"
#include "process.h"
#include "profile.h"
#include "socket.h"
#include "msg.h"
#include "iface.h"
#include "id.h"
#include "obj.h"
#include "list.h"
#include "tree.h"
Macros | |
#define | REQUEST_MAX 1024 |
#define | RESPONSE_MAX 1024 |
Functions | |
SCHEMA (default) | |
SCHEMA (global) | |
CMD (help) | |
CMD (profiles) | |
CMD (up) | |
CMD (down) | |
CMD (status) | |
CMD (state) | |
CMD (nodeid) | |
CMD (genip) | |
CMD (genbssid) | |
CMD (set) | |
CMD (get) | |
CMD (save) | |
CMD (new) | |
CMD (delete) | |
int | dispatcher_cb (co_obj_t *self, co_obj_t *fd) |
sends/receives socket messages More... | |
int | main (int argc, char *argv[]) |
Creates sockets for event loop, daemon and dispatcher. Starts/stops event loop. | |
Variables | |
co_socket_t | unix_socket_proto |
Detailed Description
commotiond - an embedded C daemon for managing mesh networks.
Function Documentation
sends/receives socket messages
- Parameters
-
self pointer to dispatcher socket struct fd file descriptor object of connected socket
References co_cmd_exec(), co_list_element(), co_list_import(), co_response_alloc(), and co_tree_insert().
Referenced by main().
737 CHECK(co_obj_data((char **)&id, co_list_element(request, 1)) == sizeof(uint32_t), "Not a valid request ID.");
749 co_tree_insert(ret, "error", sizeof("error"), co_str8_create("Incorrect command.", sizeof("Incorrect command."), 0));
int co_cmd_exec(co_obj_t *key, co_obj_t **output, co_obj_t *param)
executes a command by running the function linked to in the command struct
Definition: cmd.c:109
Definition: obj.h:131
Definition: socket.h:65
size_t co_response_alloc(char *output, const size_t olen, const uint32_t id, const co_obj_t *error, co_obj_t *result)
allocate response
Definition: msg.c:141
size_t co_list_import(co_obj_t **list, const char *input, const size_t ilen)
import list from raw representation
Definition: list.c:562
int co_tree_insert(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value)
insert object into given tree and associate with key
Definition: tree.c:332
co_obj_t * co_list_element(co_obj_t *list, const unsigned int index)
return item at specified position in list
Definition: list.c:483
Generated on Fri Jun 6 2014 13:22:05 for commotiond by 1.8.7