Skip to content
Snippets Groups Projects
Commit 792c73a1 authored by takt's avatar takt
Browse files

add IPFromNetIP

parent 8f8c1730
Branches
Tags
No related merge requests found
...@@ -23,6 +23,12 @@ func IPFromProtoIP(addr api.IP) IP { ...@@ -23,6 +23,12 @@ func IPFromProtoIP(addr api.IP) IP {
} }
} }
// IPFromNetIP converts a net.IP into a bio IP
func IPFromNetIP(addr net.IP) IP {
a, _ := IPFromBytes([]byte(addr))
return a
}
// ToProto converts an IP to a proto IP // ToProto converts an IP to a proto IP
func (ip IP) ToProto() *api.IP { func (ip IP) ToProto() *api.IP {
ver := api.IP_IPv6 ver := api.IP_IPv6
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment