From 1e469bdded4a671f71d3da8cd4666fb7fd7220fb Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 17 Sep 2004 20:21:39 +0000 Subject: [PATCH] convert NetAddr to string --- bindings/perl/Sigar.xs | 1 + bindings/perl/typemap | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/bindings/perl/Sigar.xs b/bindings/perl/Sigar.xs index 0e47c445..c56fe21d 100644 --- a/bindings/perl/Sigar.xs +++ b/bindings/perl/Sigar.xs @@ -6,6 +6,7 @@ #include "sigar_fileinfo.h" typedef sigar_t * Sigar; +typedef sigar_uint64_t Sigar__NetAddr; /* generated list */ typedef sigar_uptime_t * Sigar__Uptime; diff --git a/bindings/perl/typemap b/bindings/perl/typemap index 0317ee42..2110f638 100644 --- a/bindings/perl/typemap +++ b/bindings/perl/typemap @@ -2,6 +2,7 @@ Sigar T_PTROBJ sigar_pid_t T_UV const char * T_PV UV T_UV +Sigar::NetAddr T_NETADDR #generated list Sigar::Uptime T_PTROBJ @@ -25,3 +26,11 @@ Sigar::FileSystemUsage T_PTROBJ Sigar::ProcStat T_PTROBJ Sigar::NetRoute T_PTROBJ Sigar::NetInterfaceStat T_PTROBJ + +OUTPUT +T_NETADDR + { + char addr_str[SIGAR_INET_ADDR_LEN]; + sigar_inet_ntoa(NULL, $var, addr_str); + sv_setpv($arg, addr_str); + }