The flow diagram is based on RFC 3561 and drawn by one of my colleague Madhusanka. The code works for HELLO packet generation and receive for a zigbee node. However, the whole skeleton is coded, its not tested for other flows other than hello flow. The code was tested with Digi's Xbee module. :)