data structure initialization

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

 



Hi all,
I have came across, this kind of structure initialization for the first time.

static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
        [ICMP_ECHOREPLY] = {
                .output_entry = ICMP_MIB_OUTECHOREPS,
                .input_entry = ICMP_MIB_INECHOREPS,
                .handler = icmp_discard,
        },
        [1] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
                .error = 1,
        },
        [2] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
                .error = 1,
        },
        [ICMP_DEST_UNREACH] = {
                .output_entry = ICMP_MIB_OUTDESTUNREACHS,
                .input_entry = ICMP_MIB_INDESTUNREACHS,
                .handler = icmp_unreach,
                .error = 1,
        },
        [ICMP_SOURCE_QUENCH] = {
                .output_entry = ICMP_MIB_OUTSRCQUENCHS,
                .input_entry = ICMP_MIB_INSRCQUENCHS,
                .handler = icmp_unreach,
                .error = 1,
        },
        [ICMP_REDIRECT] = {
                .output_entry = ICMP_MIB_OUTREDIRECTS,
                .input_entry = ICMP_MIB_INREDIRECTS,
                .handler = icmp_redirect,
                .error = 1,
        },
        [6] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
        },
         [7] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
                .error = 1,
        },
        [ICMP_ECHO] = {
                .output_entry = ICMP_MIB_OUTECHOS,
                .input_entry = ICMP_MIB_INECHOS,
                .handler = icmp_echo,
        },
        [9] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
                .error = 1,
        },
        [10] = {
                .output_entry = ICMP_MIB_DUMMY,
                .input_entry = ICMP_MIB_INERRORS,
                .handler = icmp_discard,
                .error = 1,
        },
        [ICMP_TIME_EXCEEDED] = {
                .output_entry = ICMP_MIB_OUTTIMEEXCDS,
                .input_entry = ICMP_MIB_INTIMEEXCDS,
                .handler = icmp_unreach,
                .error = 1,
        },
        [ICMP_PARAMETERPROB] = {
                .output_entry = ICMP_MIB_OUTPARMPROBS,
                .input_entry = ICMP_MIB_INPARMPROBS,
                .handler = icmp_unreach,
                .error = 1,
        },
        [ICMP_TIMESTAMP] = {
                .output_entry = ICMP_MIB_OUTTIMESTAMPS,
                .input_entry = ICMP_MIB_INTIMESTAMPS,

 

[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