diff options
Diffstat (limited to 'netaddr.go')
-rw-r--r-- | netaddr.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/netaddr.go b/netaddr.go new file mode 100644 index 0000000..37ead1e --- /dev/null +++ b/netaddr.go @@ -0,0 +1,16 @@ +package salticidae + +// #include <stdlib.h> +// #include "salticidae/netaddr.h" +import "C" + +type NetAddr = *C.struct_netaddr_t + +func NewAddrFromIPPortString(addr string) (res NetAddr) { + c_str := C.CString(addr) + res = C.netaddr_new_from_sipport(c_str) + C.free(rawptr_t(c_str)) + return +} + +func (self NetAddr) Free() { C.netaddr_free(self) } |