<div dir="ltr">I think reading file sequentially & process it is a good idea for huge chunk of data. Just think about sort the data in someway (i feel, index sort or hashing would be great) & use some search mechanism. Again it is all depends on sort & search algorithm. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 7:10 PM, Victor Detoni <span dir="ltr"><<a href="mailto:victordetoni@gmail.com" target="_blank">victordetoni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm working for a network security prototype and I would like to know the best way to read diferent configs from the memory, for example:</div><div><br></div><div>My program will receive many pkts from network interface and it needs to know what's profile it will use based on source ip address.</div><div><br></div><div>First all, I'm thinking to use array in C, for example:</div><div><br></div><div>for (i=0;i<=PROFILES;i++) {</div><div> if (pkt.ip_addr == source_ip[i])</div><div> do_something(pkt,i)</div><div>}</div><div><br></div><div>I will process at about millions entries per second and ~100 profiles. What do you think? It will work fine? fast? any suggest?</div><div><br></div><div>thanks</div><span class="HOEnZb"><font color="#888888"><div>Victor</div></font></span></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>