MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nat_apply

Function nat_apply

dpdk/lib/pipeline/rte_table_action.c:1239–1265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1237}
1238
1239static int
1240nat_apply(void *data,
1241 struct rte_table_action_nat_params *p,
1242 struct rte_table_action_common_config *cfg)
1243{
1244 int status;
1245
1246 /* Check input arguments */
1247 status = nat_apply_check(p, cfg);
1248 if (status)
1249 return status;
1250
1251 /* Apply */
1252 if (p->ip_version) {
1253 struct nat_ipv4_data *d = data;
1254
1255 d->addr = rte_htonl(p->addr.ipv4);
1256 d->port = rte_htons(p->port);
1257 } else {
1258 struct nat_ipv6_data *d = data;
1259
1260 memcpy(d->addr, p->addr.ipv6, sizeof(d->addr));
1261 d->port = rte_htons(p->port);
1262 }
1263
1264 return 0;
1265}
1266
1267static __rte_always_inline uint16_t
1268nat_ipv4_checksum_update(uint16_t cksum0,

Callers 1

rte_table_action_applyFunction · 0.85

Calls 2

nat_apply_checkFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected