This is the meat of our application and the main loop for us. All the packets come here. We pick out the ip4 packets and we process each one of them.
public class IpReassemblyExample implements PcapPacketHandler
We process each Ip4 packet a little differently depending if the the Ip4.FLAG_MORE_FRAGEMNTS is set. If it is not set that means it is the last fragment, otherwise we received a packet inside fragment. If a packet is not fragmented at all, it only contains a single fragment and is always the last fragment and we treat it as a last segment.
We use to methods, bufferFragment() and bufferLastFragment() to record the fragments in the reassembly buffer. The bufferLastFragment() is a little bit special in that it records the length of the entire ip datagram we are reassembling and if all the fragments arrived in sequence it also means we're done with this buffer.
At the end of this loop, we check the time out queue to see if there is anything ready to be timed out. A better approach would be put this check in a sub thread, but for our purpose this a simple check every time a packet arrives is sufficient.
Comments
Hi, its a so nice and good
Hi, its a so nice and good site ever. Its a really great and fantastic post here in this site. So, thank you for the sharing mortgage of your ideas and thoughts to all of us.2:Good post you have managed this well because I love to have this new technology and new and innovative products designed to facilitate human need your item of interest I am doing well now in critical analysis. network + questions and reports of research in which I open the horizons of opportunities and achievements for the welfare of the land and people. could someone use my research and new theories and new things that people really want. Please pray. May I have your God bless. 3:It is look like good template exclusively for blog, but need to change colors for their own purpose, if you going to start business, homes for sale education, coaching blog it is perfect. but if you go to sports, entertainment you need to change the colors etc….
Thanks for sharing nice
Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. I like your work and would love to send this page to my friends so they can read more about ccna security questions with my friend. i like to see more post form you on the same way as you have done in past and love to visit you again with hosting reseller. keep working like this.... Have a wonderful time.
The ccna security questions- has been designed for knowledgeable security professionals in the field of security which is one of the fastest growing fields in IT.