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

Function check_pad_bytes

dpdk/lib/ipsec/esp_inb.c:431–447  ·  view source on GitHub ↗

* Helper function to check pad bytes values. * Note that pad bytes can be spread across multiple segments. */

Source from the content-addressed store, hash-verified

429 * Note that pad bytes can be spread across multiple segments.
430 */
431static inline int
432check_pad_bytes(struct rte_mbuf *mb, uint32_t ofs, uint32_t len)
433{
434 const uint8_t *pd;
435 uint32_t k, n;
436
437 for (n = 0; n != len; n += k, mb = mb->next) {
438 k = mb->data_len - ofs;
439 k = RTE_MIN(k, len - n);
440 pd = rte_pktmbuf_mtod_offset(mb, const uint8_t *, ofs);
441 if (memcmp(pd, esp_pad_bytes + n, k) != 0)
442 break;
443 ofs = 0;
444 }
445
446 return len - n;
447}
448
449/*
450 * packet checks for transport mode:

Callers 1

trs_process_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected