From: Ben Pfaff Date: Wed, 15 Feb 2012 23:13:41 +0000 (-0800) Subject: ofp-print: Remove unused function ofp_message_type_to_string(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=032f3fbd856864cdcbdf505d404e826999b8a2ae;p=openvswitch ofp-print: Remove unused function ofp_message_type_to_string(). ofputil_msg_type_name() is a better interface. Reviewed-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index f3758ce4..be2558e2 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -1637,91 +1637,6 @@ ofp_to_string(const void *oh_, size_t len, int verbosity) ds_put_hex_dump(&string, oh, len, 0, true); return ds_steal_cstr(&string); } - -/* Returns the name for the specified OpenFlow message type as a string, - * e.g. "OFPT_FEATURES_REPLY". If no name is known, the string returned is a - * hex number, e.g. "0x55". - * - * The caller must free the returned string when it is no longer needed. */ -char * -ofp_message_type_to_string(uint8_t type) -{ - const char *name; - - switch (type) { - case OFPT_HELLO: - name = "HELLO"; - break; - case OFPT_ERROR: - name = "ERROR"; - break; - case OFPT_ECHO_REQUEST: - name = "ECHO_REQUEST"; - break; - case OFPT_ECHO_REPLY: - name = "ECHO_REPLY"; - break; - case OFPT_VENDOR: - name = "VENDOR"; - break; - case OFPT_FEATURES_REQUEST: - name = "FEATURES_REQUEST"; - break; - case OFPT_FEATURES_REPLY: - name = "FEATURES_REPLY"; - break; - case OFPT_GET_CONFIG_REQUEST: - name = "GET_CONFIG_REQUEST"; - break; - case OFPT_GET_CONFIG_REPLY: - name = "GET_CONFIG_REPLY"; - break; - case OFPT_SET_CONFIG: - name = "SET_CONFIG"; - break; - case OFPT_PACKET_IN: - name = "PACKET_IN"; - break; - case OFPT_FLOW_REMOVED: - name = "FLOW_REMOVED"; - break; - case OFPT_PORT_STATUS: - name = "PORT_STATUS"; - break; - case OFPT_PACKET_OUT: - name = "PACKET_OUT"; - break; - case OFPT_FLOW_MOD: - name = "FLOW_MOD"; - break; - case OFPT_PORT_MOD: - name = "PORT_MOD"; - break; - case OFPT_STATS_REQUEST: - name = "STATS_REQUEST"; - break; - case OFPT_STATS_REPLY: - name = "STATS_REPLY"; - break; - case OFPT_BARRIER_REQUEST: - name = "BARRIER_REQUEST"; - break; - case OFPT_BARRIER_REPLY: - name = "BARRIER_REPLY"; - break; - case OFPT_QUEUE_GET_CONFIG_REQUEST: - name = "QUEUE_GET_CONFIG_REQUEST"; - break; - case OFPT_QUEUE_GET_CONFIG_REPLY: - name = "QUEUE_GET_CONFIG_REPLY"; - break; - default: - name = NULL; - break; - } - - return name ? xasprintf("OFPT_%s", name) : xasprintf("0x%02"PRIx8, type); -} static void print_and_free(FILE *stream, char *string) diff --git a/lib/ofp-print.h b/lib/ofp-print.h index 428f5ce3..ad204b1e 100644 --- a/lib/ofp-print.h +++ b/lib/ofp-print.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2011, 2012 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,6 @@ void ofp_print_match(struct ds *, const struct ofp_match *, int verbosity); char *ofp_to_string(const void *, size_t, int verbosity); char *ofp_match_to_string(const struct ofp_match *, int verbosity); char *ofp_packet_to_string(const void *data, size_t len); -char *ofp_message_type_to_string(uint8_t type); - #ifdef __cplusplus }