From 94eb71324a643f1f904451063b4d6e3db3acbc10 Mon Sep 17 00:00:00 2001 From: abbyz9 Date: Tue, 25 Nov 2008 23:29:34 +0000 Subject: [PATCH] This patch adds some functions to libspclient that allow getting the local and remote address for a session. refer r693 from sxcpu/libspclient git-svn-id: http://npfs.svn.sourceforge.net/svnroot/npfs/spfs/trunk@23 fd0465a7-2a7b-4605-b674-a3f860cb63d9 --- libspclient/fsys.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libspclient/fsys.c b/libspclient/fsys.c index a70bc0b..1cb74d6 100644 --- a/libspclient/fsys.c +++ b/libspclient/fsys.c @@ -656,3 +656,25 @@ spc_fcall_alloc(u32 msize) return fc; } + +int +spc_getladdr(Spcfsys *fs, char *buf, int buflen) +{ + if (fs->laddr) { + strncpy(buf, fs->laddr, buflen); + return 0; + } + + return -1; +} + +int +spc_getraddr(Spcfsys *fs, char *buf, int buflen) +{ + if (fs->raddr) { + strncpy(buf, fs->raddr, buflen); + return 0; + } + + return -1; +} -- 2.11.4.GIT