2 package org
.de
.metux
.ip
;
4 import org
.de
.metux
.util
.Exec
;
5 import java
.net
.UnknownHostException
;
7 public class IPIP_Device
11 public IPIP_Device(String name
)
16 public boolean delete()
18 return Exec
.exec_command("ifconfig "+if_name
+" down") &&
19 Exec
.exec_command("ip tunnel del "+if_name
);
22 // fixme: protect interface name !
26 throws UnknownHostException
30 "ip tunnel add "+if_name
+
31 " mode ipip local "+Lookup
.getIP_str(local_addr
)+
32 " remote "+Lookup
.getIP_str(remote_addr
)
35 System
.err
.println("IPIP::add executing: "+cmdline
);
36 return Exec
.exec_command(cmdline
);
39 public boolean configureIP(
44 throws UnknownHostException
46 return Exec
.exec_command(
48 " inet "+Lookup
.getIP_str(address
)+