+procedure addipsoffamily(var l:tbiniplist;const l2:tbiniplist;family:integer);\r
+var\r
+ a:integer;\r
+ biniptemp:tbinip;\r
+begin\r
+ for a := biniplist_getcount(l2)-1 downto 0 do begin\r
+ biniptemp := biniplist_get(l2,a);\r
+ if (biniptemp.family = family) then biniplist_add(l,biniptemp);\r
+ end;\r
+end;\r
+\r
+function getfamilybitlength(family:integer):integer;\r
+begin\r
+ {$ifdef ipv6}\r
+ if family = AF_INET6 then result := 128 else\r
+ {$endif}\r
+ if family = AF_INET then result := 32\r
+ else result := 0;\r
+end;\r
+\r
+function getbinipbitlength(const ip:tbinip):integer;\r
+begin\r
+ result := getfamilybitlength(ip.family);\r
+end;\r
+\r
+function getipstrbitlength(const ip:thostname):integer;\r
+var\r
+ biniptemp:tbinip;\r
+begin\r
+ ipstrtobin(ip,biniptemp);\r
+ result := getbinipbitlength(biniptemp);\r
+end;\r
+\r