Re: Question about memory in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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. 

On Wed, Feb 10, 2016 at 7:10 PM, Victor Detoni <victordetoni@xxxxxxxxx> wrote:
Hi all,

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:

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.

First all, I'm thinking to use array in C, for example:

for (i=0;i<=PROFILES;i++) {
    if (pkt.ip_addr == source_ip[i])
        do_something(pkt,i)
}

I will process at about millions entries per second and ~100 profiles. What do you think? It will work fine? fast? any suggest?

thanks
Victor

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux