From fdfdbd4e1e83d7220cda3150caac424242229aab Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 26 Dec 2012 14:36:12 -0800 Subject: [PATCH] ofproto: Remove ofproto_set_desc(). Nothing calls it, and it's a lousy interface. Signed-off-by: Ben Pfaff --- ofproto/ofproto.c | 50 ----------------------------------------------- ofproto/ofproto.h | 4 ---- 2 files changed, 54 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 42a5bafdf..00b727407 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -597,56 +597,6 @@ ofproto_set_mac_table_config(struct ofproto *ofproto, unsigned idle_time, } } -void -ofproto_set_desc(struct ofproto *p, - const char *mfr_desc, const char *hw_desc, - const char *sw_desc, const char *serial_desc, - const char *dp_desc) -{ - struct ofp_desc_stats *ods; - - if (mfr_desc) { - if (strlen(mfr_desc) >= sizeof ods->mfr_desc) { - VLOG_WARN("%s: truncating mfr_desc, must be less than %zu bytes", - p->name, sizeof ods->mfr_desc); - } - free(p->mfr_desc); - p->mfr_desc = xstrdup(mfr_desc); - } - if (hw_desc) { - if (strlen(hw_desc) >= sizeof ods->hw_desc) { - VLOG_WARN("%s: truncating hw_desc, must be less than %zu bytes", - p->name, sizeof ods->hw_desc); - } - free(p->hw_desc); - p->hw_desc = xstrdup(hw_desc); - } - if (sw_desc) { - if (strlen(sw_desc) >= sizeof ods->sw_desc) { - VLOG_WARN("%s: truncating sw_desc, must be less than %zu bytes", - p->name, sizeof ods->sw_desc); - } - free(p->sw_desc); - p->sw_desc = xstrdup(sw_desc); - } - if (serial_desc) { - if (strlen(serial_desc) >= sizeof ods->serial_num) { - VLOG_WARN("%s: truncating serial_desc, must be less than %zu " - "bytes", p->name, sizeof ods->serial_num); - } - free(p->serial_desc); - p->serial_desc = xstrdup(serial_desc); - } - if (dp_desc) { - if (strlen(dp_desc) >= sizeof ods->dp_desc) { - VLOG_WARN("%s: truncating dp_desc, must be less than %zu bytes", - p->name, sizeof ods->dp_desc); - } - free(p->dp_desc); - p->dp_desc = xstrdup(dp_desc); - } -} - int ofproto_set_snoops(struct ofproto *ofproto, const struct sset *snoops) { diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index dc5d9ce96..27a55e97c 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -231,10 +231,6 @@ void ofproto_set_flow_eviction_threshold(struct ofproto *, unsigned threshold); void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu); void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time, size_t max_entries); -void ofproto_set_desc(struct ofproto *, - const char *mfr_desc, const char *hw_desc, - const char *sw_desc, const char *serial_desc, - const char *dp_desc); int ofproto_set_snoops(struct ofproto *, const struct sset *snoops); int ofproto_set_netflow(struct ofproto *, const struct netflow_options *nf_options); -- 2.43.0