CC2420PacketHandler listener;
public int executeCommand(CommandContext context) {
MSP430 cpu = registry.getComponent(MSP430.class);
listener = new CC2420PacketHandler(cpu);
listener.setOutput(context.out);
IEEE802154Handler ieeeHandler = new IEEE802154Handler();
listener.addUpperLayerHandler(0, ieeeHandler);
ieeeHandler.setLowerLayerHandler(listener);
ipStack = new IPStack();
byte[] macAddr = new byte[] {0x2,0x12,0x74,0x00,0x11,0x11,0x12,0x12};
ipStack.setLinkLayerAddress(macAddr);
ipStack.setRouter(true);
LoWPANHandler lowpanHandler = new LoWPANHandler();
lowpanHandler.setIPStack(ipStack);
ieeeHandler.addUpperLayerHandler(0, lowpanHandler);
lowpanHandler.setLowerLayerHandler(ieeeHandler);
ipStack.setLinkLayerHandler(lowpanHandler);
context.err.print("IP Stack started");
return 0;
}