{"id":10,"date":"2005-05-02T02:33:00","date_gmt":"2005-05-02T07:33:00","guid":{"rendered":"http:\/\/www.rajatswarup.com\/blog\/?p=10"},"modified":"2010-02-11T00:01:11","modified_gmt":"2010-02-11T05:01:11","slug":"brand-new-day","status":"publish","type":"post","link":"https:\/\/www.rajatswarup.com\/blog\/2005\/05\/02\/brand-new-day\/","title":{"rendered":"Brand New Day"},"content":{"rendered":"<p>It&#8217;s a brand new day with no novelty! Back to the lab today trying to now get access to the packet data to calculate the hash values. I suspect that inside netfilter&#8217;s sk_buff structure there&#8217;s an <font style=\"font-family: Courier\">unsigned char* data<\/font> field. This probably is exactly what I need to get the hash values. There&#8217;s this <a href=\"http:\/\/www.cs.clemson.edu\/~westall\/881\/notes\/\">awesome link<\/a> which has great information about sk_buff structure. The <font style=\"font-family: Courier\">unsigned int len;<\/font> has the size of the complete input data including the headers. I guess if this len value == size of the actual data for the IP header (which could be TCP header \/ UDP header \/ ICMP header) then if we are using chunks of this data to find hashes then the following algorithm could be used:<br \/><font style=\"font-family: Courier\"><br \/>no_of_chunks = len \/ BYTE_SIZE_FOR_SIGN; <\/p>\n<p>addendum = len % BYTE_SIZE_FOR_SIGN; <\/p>\n<pre style=\"font-family: Courier\"><br \/>for (int i = 0; i < no_of_chunks; i++)<br \/>{<br \/>  storeInTable(hashRabin(data,i*BYTE_SIZE_FOR_SIGN,<br \/>               (i+1)*BYTE_SIZE_FOR_SIGN - 1 ,0));<br \/>}<br \/>storeInTable(<br \/>hashRabin(data,no_of_chunks*BYTE_SIZE_FOR_SIGN,<br \/>        no_of_chunks*BYTE_SIZE_FOR_SIGN+addendum, 0)<br \/>);<br \/><\/pre>\n<p><\/font><br \/>This are my initial thoughts let&#8217;s see how it works out!<\/p>\n<p>-Rajat.<br \/><a href=\"http:\/\/www-scf.usc.edu\/~swarup\/\">Rajat&#8217;s Homepage<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a brand new day with no novelty! Back to the lab today trying to now get access to the packet data to calculate the hash values. I suspect that inside netfilter&#8217;s sk_buff structure there&#8217;s an unsigned char* data field. This probably is exactly what I need to get the hash values. There&#8217;s this awesome [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[196],"tags":[363,362],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-programming","tag-exhaustion","tag-log"],"_links":{"self":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":1,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions\/161"}],"wp:attachment":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}