Looks good, Ethan
On Wed, Feb 15, 2012 at 16:37, Ben Pfaff <b...@nicira.com> wrote: > ofputil_msg_type_name() is a better interface. > > Signed-off-by: Ben Pfaff <b...@nicira.com> > --- > lib/ofp-print.c | 85 > ------------------------------------------------------- > lib/ofp-print.h | 4 +-- > 2 files changed, 1 insertions(+), 88 deletions(-) > > diff --git a/lib/ofp-print.c b/lib/ofp-print.c > index f1eeebb..99ce8ca 100644 > --- a/lib/ofp-print.c > +++ b/lib/ofp-print.c > @@ -1626,91 +1626,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 428f5ce..ad204b1 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 > } > -- > 1.7.2.5 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev