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); + }