void udplite_init(void) { in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE, UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, IPI_HASHFIELDS_2TUPLE); }
void rip_init(void) { in_pcbinfo_init(&V_ripcbinfo, "rip", &V_ripcb, INP_PCBHASH_RAW_SIZE, 1, "ripcb", rip_inpcb_init, IPI_HASHFIELDS_NONE); EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL, EVENTHANDLER_PRI_ANY); }
static void div_init(void) { /* * XXX We don't use the hash list for divert IP, but it's easier to * allocate one-entry hash lists than it is to check all over the * place for hashbase == NULL. */ in_pcbinfo_init(&V_divcbinfo, "div", &V_divcb, 1, 1, "divcb", div_inpcb_init, div_inpcb_fini, 0, IPI_HASHFIELDS_NONE); }
void udp_init(void) { in_pcbinfo_init(&V_udbinfo, "udp", &V_udb, UDBHASHSIZE, UDBHASHSIZE, "udp_inpcb", udp_inpcb_init, NULL, UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE); V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(V_udpcb_zone, maxsockets); uma_zone_set_warning(V_udpcb_zone, "kern.ipc.maxsockets limit reached"); EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL, EVENTHANDLER_PRI_ANY); }
void udp_init(void) { /* * For now default to 2-tuple UDP hashing - until the fragment * reassembly code can also update the flowid. * * Once we can calculate the flowid that way and re-establish * a 4-tuple, flip this to 4-tuple. */ in_pcbinfo_init(&V_udbinfo, "udp", &V_udb, UDBHASHSIZE, UDBHASHSIZE, "udp_inpcb", udp_inpcb_init, IPI_HASHFIELDS_2TUPLE); V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_udpcb_zone, maxsockets); uma_zone_set_warning(V_udpcb_zone, "kern.ipc.maxsockets limit reached"); EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL, EVENTHANDLER_PRI_ANY); }
void udp_init(void) { struct inpcbportinfo *portinfo; int cpu; portinfo = kmalloc_cachealign(sizeof(*portinfo) * ncpus2, M_PCB, M_WAITOK); for (cpu = 0; cpu < ncpus2; cpu++) { struct inpcbinfo *uicb = &udbinfo[cpu]; /* * NOTE: * UDP pcb list, wildcard hash table and localgroup hash * table are shared. */ in_pcbinfo_init(uicb, cpu, TRUE); uicb->hashbase = hashinit(UDBHASHSIZE, M_PCB, &uicb->hashmask); in_pcbportinfo_init(&portinfo[cpu], UDBHASHSIZE, TRUE, cpu); uicb->portinfo = portinfo; uicb->portinfo_mask = ncpus2_mask; uicb->wildcardhashbase = hashinit(UDBHASHSIZE, M_PCB, &uicb->wildcardhashmask); uicb->localgrphashbase = hashinit(UDBHASHSIZE, M_PCB, &uicb->localgrphashmask); uicb->ipi_size = sizeof(struct inpcb); } /* * Initialize UDP statistics counters for each CPU. */ for (cpu = 0; cpu < ncpus; ++cpu) bzero(&udpstat_percpu[cpu], sizeof(struct udpstat)); }