598 |
| _ -> assert false |
| _ -> assert false |
599 |
|
|
600 |
|
|
601 |
let get_addr s pos = |
let get_addr proto s pos = |
602 |
|
let addr, pos = |
603 |
match get_uint8 s pos with |
match get_uint8 s pos with |
604 |
0 -> |
0 -> |
605 |
let ip = get_ip s (pos+1) in |
let ip = get_ip s (pos+1) in |
608 |
let name,pos = get_string s (pos+1) in |
let name,pos = get_string s (pos+1) in |
609 |
Ip.addr_of_string name, pos |
Ip.addr_of_string name, pos |
610 |
| _ -> assert false |
| _ -> assert false |
611 |
|
in |
612 |
|
let blocked, pos = |
613 |
|
if proto > 33 then get_bool s pos, pos+1 |
614 |
|
else false, pos |
615 |
|
in |
616 |
|
addr, pos |
617 |
|
|
618 |
let get_server proto s pos = |
let get_server proto s pos = |
619 |
let num = get_int s pos in |
let num = get_int s pos in |
621 |
let addr, pos = if proto < 2 then |
let addr, pos = if proto < 2 then |
622 |
Ip.addr_of_ip (get_ip s (pos+8)), pos+12 |
Ip.addr_of_ip (get_ip s (pos+8)), pos+12 |
623 |
else |
else |
624 |
get_addr s (pos+8) |
get_addr proto s (pos+8) |
625 |
in |
in |
626 |
let port = get_int16 s pos in |
let port = get_int16 s pos in |
627 |
let score = get_int s (pos+2) in |
let score = get_int s (pos+2) in |