/[mldonkey]/mldonkey/src/utils/net/ip.ml
ViewVC logotype

Diff of /mldonkey/src/utils/net/ip.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by spiralvoice, Thu Sep 1 00:04:12 2005 UTC revision 1.15 by spiralvoice, Thu Sep 1 16:44:29 2005 UTC
# Line 115  let compare ((a4,a3,a2,a1) as a) ((b4,b3 Line 115  let compare ((a4,a3,a2,a1) as a) ((b4,b3
115    if c2 <> 0 then c2 else    if c2 <> 0 then c2 else
116    compare a1 b1    compare a1 b1
117    
118    let succ (a4,a3,a2,a1) =
119      if a1 < 255 then
120        (a4,a3,a2,a1+1)
121      else if a2 < 255 then
122        (a4,a3,a2+1,0)
123      else if a3 < 255 then
124        (a4,a3+1,0,0)
125      else if a4 < 255 then
126        (a4+1,0,0,0)
127      else
128        (0,0,0,0) (* or exception ? *)
129    
130    let pred (a4,a3,a2,a1) =
131      if a1 > 0 then
132        (a4,a3,a2,a1-1)
133      else if a2 > 0 then
134        (a4,a3,a2-1,255)
135      else if a3 > 0 then
136        (a4,a3-1,255,255)
137      else if a4 > 0 then
138        (a4-1,255,255,255)
139      else
140        (255,255,255,255) (* or exception ? *)
141    
142  let localhost = of_string "127.0.0.1"  let localhost = of_string "127.0.0.1"
143    
144  let to_sockaddr ip port =  let to_sockaddr ip port =

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26