public HipRunner(String conf) {
		try {
			__configuration = HipConfiguration
					.getConfiguration(conf.equals("") ? "hip_config.xml" : conf);
			__netmon = NetMonitor.getMonitor(3000);
			__netmon.registerCallback(this);
			__sadb = HipSadbImpl.getInstance();
			__ipsec = new HipIpsecImpl();
			__protocol = new HipProtocol(__ipsec);

			KeyFactory keyFact = KeyFactoryImpl.getInstance();

			RSAPublicKey rsaPublicKey = null;
			RSAPrivateKey rsaPrivateKey = null;

			if (__configuration
					.get(HipConfiguration.LOCAL_HOST_IDENTITY_PUBLIC) == null
					|| __configuration.get(
							HipConfiguration.LOCAL_HOST_IDENTITY_PUBLIC)
							.equals("")
					|| __configuration.get(
							HipConfiguration.LOCAL_HOST_IDENTITY_PRIVATE)
							.equals("")) {

				__rsaKeyPair = keyFact.generateRSA(1024);

				rsaPublicKey = (RSAPublicKey) __rsaKeyPair.getPublic();
				rsaPrivateKey = (RSAPrivateKey) __rsaKeyPair.getPrivate();

				__configuration.set(HipConfiguration.LOCAL_HOST_IDENTITY_ALGO,
						KeyFactoryImpl.RSA_KEY);
				__configuration.set(
						HipConfiguration.LOCAL_HOST_IDENTITY_PUBLIC, Helpers
								.toHexString(keyFact.encodeKey(rsaPublicKey),
										""));
				__configuration.set(
						HipConfiguration.LOCAL_HOST_IDENTITY_PRIVATE, Helpers
								.toHexString(keyFact.encodeKey(rsaPrivateKey),
										""));
				__configuration.flushConfiguration();

				RSAPublicKey rsaPublicKey2 = (RSAPublicKey) keyFact
						.dnsKeytoRSAPublic(Helpers
								.hexStringToByteArray(__configuration
										.get(HipConfiguration.LOCAL_HOST_IDENTITY_PUBLIC)));
			} else {
				rsaPublicKey = (RSAPublicKey) keyFact
						.dnsKeytoRSAPublic(Helpers
								.hexStringToByteArray(__configuration
										.get(HipConfiguration.LOCAL_HOST_IDENTITY_PUBLIC)));
				rsaPrivateKey = (RSAPrivateKey) keyFact
						.dnsKeytoRSAPrivate(Helpers
								.hexStringToByteArray(__configuration
										.get(HipConfiguration.LOCAL_HOST_IDENTITY_PRIVATE)));
				__rsaKeyPair = new KeyPair(rsaPublicKey, rsaPrivateKey);
			}

			__signature = new RSASignature();

			__hiParam = new HostIDParameter(0);
			__hiParam.setHI(KeyFactoryImpl.getInstance()
					.encodeKey(rsaPublicKey));

			__transform = new short[] { 1 };

			__dhgroup = new short[] { 3 };

			__hi = new HostIdentity(keyFact.encodeKey(rsaPublicKey),
					HostIdentity.RSASHA1, (short) 0x202, HostIdentity.PROTO_ANY);

			__hitMy = new HostIdentityTag(__hi);

			__r1cache = HipR1Cache.getCache(__hitMy, __hi, __rsaKeyPair
					.getPrivate(), __dhgroup, __transform, __puzzleDifficulty,
					__puzzleLifetime);

			__dummyAddress = new DummyDevice.DeviceAddress(__hitMy
					.getAsAddress(), 28);
			__dummy.setNotifier(this);
			__raw.setNotifier(this);
			__raw.setProtocol(139);
			__raw.setFamily(RawSocket.PF_INET);
			if (!__raw.open()) {
				System.out.println("Failed to open a socket");
				System.exit(-1);
			}

			__rawesp.setNotifier(this);
			__rawesp.setProtocol(50);
			__rawesp.setFamily(RawSocket.PF_INET);
			if (!__rawesp.open()) {
				System.out.println("Failed to open a socket ESP raw socket");
				System.exit(-1);
			}
			__dummy.open();
			__dummy.setDefaultMTU(1460);
			__dummy.setSupportARP(true);
			__dummy.setAppendEther(true);
			__dummy.setDeviceAddrs(__dummyAddress);
			__maintenance = HipMaintenance.getMaintenance(__sadb, __raw);

		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}