X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2Fikev2%2Fikev2_payload.c;h=294864d8c439f14c4c955737f86af7d3eccc5948;hb=3f59c639609be9768f592111e5f8a8a2c23db3ac;hp=c03054aa9cd3d234fc2aead119216a528593f250;hpb=84962d19ba76eafd5c7658aa86ec61c9b81f7702;p=vpp.git diff --git a/src/plugins/ikev2/ikev2_payload.c b/src/plugins/ikev2/ikev2_payload.c index c03054aa9cd..294864d8c43 100644 --- a/src/plugins/ikev2/ikev2_payload.c +++ b/src/plugins/ikev2/ikev2_payload.c @@ -588,6 +588,30 @@ ikev2_parse_delete_payload (ike_payload_header_t * ikep, u32 rlen) return r; } +u8 * +ikev2_find_ike_notify_payload (ike_header_t * ike, u32 msg_type) +{ + int p = 0; + ike_notify_payload_header_t *n; + ike_payload_header_t *ikep; + u32 payload = ike->nextpayload; + + while (payload != IKEV2_PAYLOAD_NONE) + { + ikep = (ike_payload_header_t *) & ike->payload[p]; + if (payload == IKEV2_PAYLOAD_NOTIFY) + { + n = (ike_notify_payload_header_t *)ikep; + if (n->msg_type == clib_net_to_host_u16 (msg_type)) + return n->payload; + } + u16 plen = clib_net_to_host_u16 (ikep->length); + payload = ikep->nextpayload; + p += plen; + } + return 0; +} + /* * fd.io coding-style-patch-verification: ON *