package jos.system.net.jeps;
class Main
{
public static void main(String[] argv)
{
EthernetNetworkInterface ethnic= new EthernetNetworkInterface
(new EtherHostDriver("eth0"));
DummyNetworkInterface dummy= new DummyNetworkInterface();
ethnic.setIPAddr(new IPAddr((byte)10,(byte)10,(byte)10,(byte)10));
dummy.setIPAddr(new IPAddr((byte)192,(byte)168,(byte)1,(byte)1));
IP ip = new IP();
ip.addInterface(ethnic);
ip.addInterface(dummy);
ethnic.addProtocol(ip);
dummy.addProtocol(ip);
// Set the routes.
// To local net
ip.addRoute(new IPAddr((byte)10,(byte)10,(byte)10,(byte)0),
new IPAddr((byte)255,(byte)255,(byte)255,(byte)0),
null,
0,
ethnic);
// To fake net "connected" to the dummy interface
ip.addRoute(new IPAddr((byte)192,(byte)168,(byte)1,(byte)0),
new IPAddr((byte)255,(byte)255,(byte)255,(byte)0),
null,
0,
dummy);
// MISSING: loopback.
// To the rest of the internet through my gateway.
ip.setDefaultRoute(null,
null,
new IPAddr((byte)10,(byte)10,(byte)10,(byte)1),
1,
null);
ethnic.up();
dummy.up();
try {(new QuoteServerThread()).start();} catch (java.io.IOException e) {}
try {System.in.read();} catch (java.io.IOException e) {}
ethnic.down();
dummy.down();
}
}