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

Function match_convert_ipv6_depth

dpdk/examples/ip_pipeline/thread.c:2299–2344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2297}
2298
2299static int
2300match_convert_ipv6_depth(uint32_t depth, uint32_t *depth32)
2301{
2302 if (depth > 128)
2303 return -1;
2304
2305 switch (depth / 32) {
2306 case 0:
2307 depth32[0] = depth;
2308 depth32[1] = 0;
2309 depth32[2] = 0;
2310 depth32[3] = 0;
2311 return 0;
2312
2313 case 1:
2314 depth32[0] = 32;
2315 depth32[1] = depth - 32;
2316 depth32[2] = 0;
2317 depth32[3] = 0;
2318 return 0;
2319
2320 case 2:
2321 depth32[0] = 32;
2322 depth32[1] = 32;
2323 depth32[2] = depth - 64;
2324 depth32[3] = 0;
2325 return 0;
2326
2327 case 3:
2328 depth32[0] = 32;
2329 depth32[1] = 32;
2330 depth32[2] = 32;
2331 depth32[3] = depth - 96;
2332 return 0;
2333
2334 case 4:
2335 depth32[0] = 32;
2336 depth32[1] = 32;
2337 depth32[2] = 32;
2338 depth32[3] = 32;
2339 return 0;
2340
2341 default:
2342 return -1;
2343 }
2344}
2345
2346static int
2347match_convert(struct table_rule_match *mh,

Callers 1

match_convertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected