1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

revert changes for node_lookup_vtable()

This commit is contained in:
Steffen Vogel 2015-03-17 22:47:43 +01:00
parent b29c86032e
commit c081729cb5
2 changed files with 5 additions and 15 deletions

View file

@ -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.
*

View file

@ -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;