aboutsummaryrefslogtreecommitdiff
path: root/netaddr.go
blob: 37ead1e68e81d21609210eefc1c8c665d338ba75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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) }