From 9e7df18a42ce58df546cb35909622403dbdfe473 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 5 Sep 2008 14:33:08 -0700 Subject: [PATCH] vconn: New function vconn_get_name(). --- include/vconn.h | 1 + lib/vconn.c | 7 +++++++ 2 files changed, 8 insertions(+) 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 -- 2.30.2