From 24a5e99d61847248cd43916d76db093dc018626e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 4 Mar 2009 09:57:13 -0800 Subject: [PATCH] vconn: New function pvconn_get_name(). --- lib/vconn.c | 8 ++++++++ lib/vconn.h | 1 + 2 files changed, 9 insertions(+) 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 *); -- 2.30.2