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

Function sctp_serialize_hmaclist

freebsd/netinet/sctp_auth.c:748–763  ·  view source on GitHub ↗

- * serialize the HMAC algo list and return space used * caller must guarantee ptr has appropriate space */

Source from the content-addressed store, hash-verified

746 * caller must guarantee ptr has appropriate space
747 */
748int
749sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr)
750{
751 int i;
752 uint16_t hmac_id;
753
754 if (list == NULL)
755 return (0);
756
757 for (i = 0; i < list->num_algo; i++) {
758 hmac_id = htons(list->hmac[i]);
759 memcpy(ptr, &hmac_id, sizeof(hmac_id));
760 ptr += sizeof(hmac_id);
761 }
762 return (list->num_algo * sizeof(hmac_id));
763}
764
765int
766sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs)

Callers 3

sctp_send_initiateFunction · 0.85
sctp_send_initiate_ackFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected