From: Ben Pfaff Date: Fri, 5 Sep 2008 21:33:08 +0000 (-0700) Subject: vconn: New function vconn_get_name(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7df18a42ce58df546cb35909622403dbdfe473;p=openvswitch vconn: New function vconn_get_name(). --- diff --git a/include/vconn.h b/include/vconn.h index ec98859d..6dcfd675 100644 --- a/include/vconn.h +++ b/include/vconn.h @@ -50,6 +50,7 @@ struct vconn; void vconn_usage(bool active, bool passive); int vconn_open(const char *name, struct vconn **); void vconn_close(struct vconn *); +const char *vconn_get_name(const struct vconn *); bool vconn_is_passive(const struct vconn *); uint32_t vconn_get_ip(const struct vconn *); int vconn_connect(struct vconn *); diff --git a/lib/vconn.c b/lib/vconn.c index 3e06dc34..acb35d44 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -217,6 +217,13 @@ vconn_close(struct vconn *vconn) } } +/* Returns the name of 'vconn', that is, the string passed to vconn_open(). */ +const char * +vconn_get_name(const struct vconn *vconn) +{ + return vconn->name; +} + /* Returns true if 'vconn' is a passive vconn, that is, its purpose is to * wait for connections to arrive, not to transfer data. Returns false if * 'vconn' is an active vconn, that is, its purpose is to transfer data, not