diff --git a/server/include/list.h b/server/include/list.h index c811c9b66..335b26365 100644 --- a/server/include/list.h +++ b/server/include/list.h @@ -24,7 +24,7 @@ struct gtfpga; struct opal; /** Static list initialization */ -#define LIST_INIT(dtor) (struct list) { \ +#define LIST_INIT(dtor) { \ .head = NULL, \ .tail = NULL, \ .length = 0, \ diff --git a/server/include/node.h b/server/include/node.h index 307bf8f75..1b4307a87 100644 --- a/server/include/node.h +++ b/server/include/node.h @@ -141,23 +141,24 @@ struct node_type { */ struct node { + /** A short identifier of the node, only used for configuration and logging */ + char *name; /** How many paths are sending / receiving from this node? */ int refcnt; /** Number of messages to send / recv at once (scatter / gather) */ int combine; /** CPU Affinity of this node */ int affinity; - /** A short identifier of the node, only used for configuration and logging */ - const char *name; /** C++ like virtual function call table */ - struct node_vtable *vt; + struct node_type * vt; /** Virtual data (used by vtable functions) */ union { struct socket *socket; struct opal *opal; struct gtfpga *gtfpga; struct file *file; + struct ngsi *ngsi; }; /** A pointer to the libconfig object which instantiated this node */ @@ -208,21 +209,6 @@ int node_start_defer(struct node *n); */ int node_stop(struct node *n); -/** Lookup string representation of socket type - * - * @param str A string describing the socket type. This must be one of: tcp, tcpd, udp, ip, ieee802.3 or opal - * @return A pointer to the vtable, or NULL if there is no socket type / vtable with this id. - */ -struct node_vtable * node_lookup_vtable(const char *str); - -/** Search list of nodes for a name. - * - * @param str The name of the wanted node - * @param nodes A linked list of all nodes - * @return A pointer to the node or NULL if not found - */ -struct node * node_lookup_name(const char *str, struct list *nodes); - /** Reverse local and remote socket address. * This is usefull for the helper programs: send, receive, test * because they usually use the same configuration file as the diff --git a/server/src/cfg.c b/server/src/cfg.c index ad1694cd5..992678d23 100644 --- a/server/src/cfg.c +++ b/server/src/cfg.c @@ -186,7 +186,7 @@ int config_parse_nodelist(config_setting_t *cfg, struct list *list, struct list case CONFIG_TYPE_STRING: str = config_setting_get_string(cfg); if (str) { - node = list_lookup(all, str) + node = list_lookup(all, str); if (node) list_push(list, node); else