From: Ben Pfaff Date: Wed, 4 Mar 2009 17:57:13 +0000 (-0800) Subject: vconn: New function pvconn_get_name(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24a5e99d61847248cd43916d76db093dc018626e;p=openvswitch vconn: New function pvconn_get_name(). --- diff --git a/lib/vconn.c b/lib/vconn.c index 6755734a..4dd25a67 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -724,6 +724,14 @@ pvconn_open(const char *name, struct pvconn **pvconnp) return EAFNOSUPPORT; } +/* Returns the name that was used to open 'pvconn'. The caller must not + * modify or free the name. */ +const char * +pvconn_get_name(const struct pvconn *pvconn) +{ + return pvconn->name; +} + /* Closes 'pvconn'. */ void pvconn_close(struct pvconn *pvconn) diff --git a/lib/vconn.h b/lib/vconn.h index 375f155c..192962c4 100644 --- a/lib/vconn.h +++ b/lib/vconn.h @@ -79,6 +79,7 @@ void vconn_send_wait(struct vconn *); /* Passive vconns: virtual listeners for incoming OpenFlow connections. */ int pvconn_open(const char *name, struct pvconn **); +const char *pvconn_get_name(const struct pvconn *); void pvconn_close(struct pvconn *); int pvconn_accept(struct pvconn *, int min_version, struct vconn **); void pvconn_wait(struct pvconn *);