Lines Matching refs:repl
1118 static inline int iptcc_compile_rule (struct xtc_handle *h, STRUCT_REPLACE *repl, struct rule_head … in iptcc_compile_rule() argument
1137 memcpy((char *)repl->entries+r->offset, r->entry, r->size); in iptcc_compile_rule()
1143 static int iptcc_compile_chain(struct xtc_handle *h, STRUCT_REPLACE *repl, struct chain_head *c) in iptcc_compile_chain() argument
1153 head = (void *)repl->entries + c->head_offset; in iptcc_compile_chain()
1161 repl->hook_entry[c->hooknum-1] = c->head_offset; in iptcc_compile_chain()
1162 repl->underflow[c->hooknum-1] = c->foot_offset; in iptcc_compile_chain()
1167 ret = iptcc_compile_rule(h, repl, r); in iptcc_compile_chain()
1173 foot = (void *)repl->entries + c->foot_offset; in iptcc_compile_chain()
1249 static int iptcc_compile_table(struct xtc_handle *h, STRUCT_REPLACE *repl) in iptcc_compile_table() argument
1256 int ret = iptcc_compile_chain(h, repl, c); in iptcc_compile_table()
1262 error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE; in iptcc_compile_table()
2481 STRUCT_REPLACE *repl, unsigned int idx, in counters_normal_map() argument
2491 newcounters->counters[idx] = repl->counters[mappos]; in counters_normal_map()
2496 STRUCT_REPLACE *repl, unsigned int idx, in counters_map_zeroed() argument
2507 &repl->counters[mappos], in counters_map_zeroed()
2528 STRUCT_REPLACE *repl; in TC_COMMIT() local
2549 repl = malloc(sizeof(*repl) + new_size); in TC_COMMIT()
2550 if (!repl) { in TC_COMMIT()
2554 memset(repl, 0, sizeof(*repl) + new_size); in TC_COMMIT()
2564 repl->counters = malloc(sizeof(STRUCT_COUNTERS) in TC_COMMIT()
2566 if (!repl->counters) { in TC_COMMIT()
2578 strcpy(repl->name, handle->info.name); in TC_COMMIT()
2579 repl->num_entries = new_number; in TC_COMMIT()
2580 repl->size = new_size; in TC_COMMIT()
2582 repl->num_counters = handle->info.num_entries; in TC_COMMIT()
2583 repl->valid_hooks = handle->info.valid_hooks; in TC_COMMIT()
2586 repl->num_entries, repl->size, repl->num_counters); in TC_COMMIT()
2588 ret = iptcc_compile_table(handle, repl); in TC_COMMIT()
2600 write(fd, repl, sizeof(*repl) + repl->size); in TC_COMMIT()
2606 ret = setsockopt(handle->sockfd, TC_IPPROTO, SO_SET_REPLACE, repl, in TC_COMMIT()
2607 sizeof(*repl) + repl->size); in TC_COMMIT()
2626 counters_normal_map(newcounters, repl, in TC_COMMIT()
2631 counters_map_zeroed(newcounters, repl, in TC_COMMIT()
2651 counters_normal_map(newcounters, repl, in TC_COMMIT()
2657 counters_map_zeroed(newcounters, repl, in TC_COMMIT()
2687 free(repl->counters); in TC_COMMIT()
2688 free(repl); in TC_COMMIT()
2697 free(repl->counters); in TC_COMMIT()
2699 free(repl); in TC_COMMIT()