X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibcollectdclient%2Fcollectd%2Fserver.h;h=e50df17df77b75137c3e7a842b4fd22ccee2044a;hb=7c9d772c992647fcba64a96800c146eb9f1647f8;hp=d19021734d30e364cd3098d1cc66aebc96d61f7d;hpb=1cee13d802444f4062a373192e83ba92608d7f3b;p=collectd.git diff --git a/src/libcollectdclient/collectd/server.h b/src/libcollectdclient/collectd/server.h index d1902173..e50df17d 100644 --- a/src/libcollectdclient/collectd/server.h +++ b/src/libcollectdclient/collectd/server.h @@ -34,6 +34,10 @@ #include +#ifndef LCC_NETWORK_BUFFER_SIZE +#define LCC_NETWORK_BUFFER_SIZE 1452 +#endif + LCC_BEGIN_DECLS /* lcc_network_parser_t is a callback that parses received network packets. It @@ -44,7 +48,9 @@ typedef int (*lcc_network_parser_t)(void *payload, size_t payload_size, /* lcc_listener_t holds parameters for running a collectd server. */ typedef struct { - /* conn is a UDP socket for the server to listen on. */ + /* conn is a UDP socket for the server to listen on. If set to <0 node and + * service will be used to open a new UDP socket. If >=0, it is the caller's + * job to clean up the socket. */ int conn; /* node is the local address to listen on if conn is <0. Defaults to "::" (any @@ -62,12 +68,13 @@ typedef struct { /* parse_options contains options for parser and is passed on verbatimely. */ lcc_network_parse_options_t parse_options; - /* buffer_size determines the maximum packet size to accept. */ + /* buffer_size determines the maximum packet size to accept. Defaults to + * LCC_NETWORK_BUFFER_SIZE if set to zero. */ uint16_t buffer_size; /* interface is the name of the interface to use when subscribing to a * multicast group. Has no effect when using unicast. */ - char *interface; + char *iface; } lcc_listener_t; /* lcc_listen_and_write listens on the provided UDP socket (or opens one using