Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_dummynet.c
| Show First 20 Lines • Show All 2,556 Lines • ▼ Show 20 Lines | ip_dn_ctl(struct sockopt *sopt) | ||||
| return error ; | return error ; | ||||
| } | } | ||||
| static void | static void | ||||
| ip_dn_vnet_init(void) | ip_dn_vnet_init(void) | ||||
| { | { | ||||
| if (V_dn_cfg.init_done) | if (V_dn_cfg.init_done) | ||||
| return; | return; | ||||
| V_dn_cfg.init_done = 1; | |||||
| /* Set defaults here. MSVC does not accept initializers, | /* Set defaults here. MSVC does not accept initializers, | ||||
| * and this is also useful for vimages | * and this is also useful for vimages | ||||
| */ | */ | ||||
| /* queue limits */ | /* queue limits */ | ||||
| V_dn_cfg.slot_limit = 100; /* Foot shooting limit for queues. */ | V_dn_cfg.slot_limit = 100; /* Foot shooting limit for queues. */ | ||||
| V_dn_cfg.byte_limit = 1024 * 1024; | V_dn_cfg.byte_limit = 1024 * 1024; | ||||
| V_dn_cfg.expire = 1; | V_dn_cfg.expire = 1; | ||||
| Show All 22 Lines | ip_dn_vnet_init(void) | ||||
| heap_init(&V_dn_cfg.evheap, 16, offsetof(struct dn_id, id)); | heap_init(&V_dn_cfg.evheap, 16, offsetof(struct dn_id, id)); | ||||
| SLIST_INIT(&V_dn_cfg.fsu); | SLIST_INIT(&V_dn_cfg.fsu); | ||||
| DN_LOCK_INIT(); | DN_LOCK_INIT(); | ||||
| /* Initialize curr_time adjustment mechanics. */ | /* Initialize curr_time adjustment mechanics. */ | ||||
| getmicrouptime(&V_dn_cfg.prev_t); | getmicrouptime(&V_dn_cfg.prev_t); | ||||
| V_dn_cfg.init_done = 1; | |||||
| } | } | ||||
| static void | static void | ||||
| ip_dn_vnet_destroy(void) | ip_dn_vnet_destroy(void) | ||||
| { | { | ||||
| DN_BH_WLOCK(); | DN_BH_WLOCK(); | ||||
| dummynet_flush(); | dummynet_flush(); | ||||
| DN_BH_WUNLOCK(); | DN_BH_WUNLOCK(); | ||||
| ▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines | |||||