ip_fw_table.c (306025) | ip_fw_table.c (307970) |
---|---|
1/*- 2 * Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko. 3 * Copyright (c) 2014 Yandex LLC 4 * Copyright (c) 2014 Alexander V. Chernikov 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko. 3 * Copyright (c) 2014 Yandex LLC 4 * Copyright (c) 2014 Alexander V. Chernikov 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: stable/11/sys/netpfil/ipfw/ip_fw_table.c 306025 2016-09-20 13:23:08Z ae $"); | 29__FBSDID("$FreeBSD: stable/11/sys/netpfil/ipfw/ip_fw_table.c 307970 2016-10-26 17:34:33Z ae $"); |
30 31/* 32 * Lookup table support for ipfw. 33 * 34 * This file contains handlers for all generic tables' operations: 35 * add/del/flush entries, list/dump tables etc.. 36 * 37 * Table data modification is protected by both UH and runtime lock --- 1044 unchanged lines hidden (view full) --- 1082 struct sockopt_data *sd) 1083{ 1084 ipfw_obj_tentry *tent; 1085 ipfw_obj_header *oh; 1086 struct tid_info ti; 1087 struct table_config *tc; 1088 struct table_algo *ta; 1089 struct table_info *kti; | 30 31/* 32 * Lookup table support for ipfw. 33 * 34 * This file contains handlers for all generic tables' operations: 35 * add/del/flush entries, list/dump tables etc.. 36 * 37 * Table data modification is protected by both UH and runtime lock --- 1044 unchanged lines hidden (view full) --- 1082 struct sockopt_data *sd) 1083{ 1084 ipfw_obj_tentry *tent; 1085 ipfw_obj_header *oh; 1086 struct tid_info ti; 1087 struct table_config *tc; 1088 struct table_algo *ta; 1089 struct table_info *kti; |
1090 struct table_value *pval; |
|
1090 struct namedobj_instance *ni; 1091 int error; 1092 size_t sz; 1093 1094 /* Check minimum header size */ 1095 sz = sizeof(*oh) + sizeof(*tent); 1096 if (sd->valsize != sz) 1097 return (EINVAL); --- 29 unchanged lines hidden (view full) --- 1127 1128 kti = KIDX_TO_TI(ch, tc->no.kidx); 1129 ta = tc->ta; 1130 1131 if (ta->find_tentry == NULL) 1132 return (ENOTSUP); 1133 1134 error = ta->find_tentry(tc->astate, kti, tent); | 1091 struct namedobj_instance *ni; 1092 int error; 1093 size_t sz; 1094 1095 /* Check minimum header size */ 1096 sz = sizeof(*oh) + sizeof(*tent); 1097 if (sd->valsize != sz) 1098 return (EINVAL); --- 29 unchanged lines hidden (view full) --- 1128 1129 kti = KIDX_TO_TI(ch, tc->no.kidx); 1130 ta = tc->ta; 1131 1132 if (ta->find_tentry == NULL) 1133 return (ENOTSUP); 1134 1135 error = ta->find_tentry(tc->astate, kti, tent); |
1135 | 1136 if (error == 0) { 1137 pval = get_table_value(ch, tc, tent->v.kidx); 1138 ipfw_export_table_value_v1(pval, &tent->v.value); 1139 } |
1136 IPFW_UH_RUNLOCK(ch); 1137 1138 return (error); 1139} 1140 1141/* 1142 * Flushes all entries or destroys given table. 1143 * Data layout (v0)(current): --- 2181 unchanged lines hidden --- | 1140 IPFW_UH_RUNLOCK(ch); 1141 1142 return (error); 1143} 1144 1145/* 1146 * Flushes all entries or destroys given table. 1147 * Data layout (v0)(current): --- 2181 unchanged lines hidden --- |