From c081729cb55c70dd9fa9ce947cb7f101cc304527 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 17 Mar 2015 22:47:43 +0100 Subject: [PATCH] revert changes for node_lookup_vtable() --- server/include/node.h | 8 ++------ server/src/node.c | 12 +++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/server/include/node.h b/server/include/node.h index b862a9a3b..533ac724e 100644 --- a/server/include/node.h +++ b/server/include/node.h @@ -118,14 +118,10 @@ int node_stop(struct node *n); /** Lookup string representation of socket type * - * You can either provide a node type in string or enum representation. - * Set str to NULL, to use the enum type. - * - * @param str A string describing the socket type. This must be one of: tcp, tcpd, udp, ip, ieee802.3 - * @param enu The enum type of the socket. + * @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 const * node_lookup_vtable(const char *str, struct node_type enu); +struct node_vtable const * node_lookup_vtable(const char *str); /** Search list of nodes for a name. * diff --git a/server/src/node.c b/server/src/node.c index 0cb830343..21c4e8048 100644 --- a/server/src/node.c +++ b/server/src/node.c @@ -47,17 +47,11 @@ struct node * node_lookup_name(const char *str, struct node *nodes) return NULL; } -struct node_vtable const * node_lookup_vtable(const char *str, struct node_type enu) +struct node_vtable const * node_lookup_vtable(const char *str) { for (int i = 0; i < ARRAY_LEN(vtables); i++) { - if (str) { - if (!strcmp(vtables[i].name, str)) - return &vtables[i]; - } - else { - if (vtables[i].type == enu) - return &vtables[i]; - } + if (!strcmp(vtables[i].name, str)) + return &vtables[i]; } return NULL;