Lines Matching refs:srh

92 static void print_srh(FILE *fp, struct ipv6_sr_hdr *srh)  in print_srh()  argument
96 fprintf(fp, "segs %d [ ", srh->first_segment + 1); in print_srh()
98 for (i = srh->first_segment; i >= 0; i--) in print_srh()
100 rt_addr_n2a(AF_INET6, 16, &srh->segments[i])); in print_srh()
104 if (sr_has_hmac(srh)) { in print_srh()
105 unsigned int offset = ((srh->hdrlen + 1) << 3) - 40; in print_srh()
108 tlv = (struct sr6_tlv_hmac *)((char *)srh + offset); in print_srh()
152 print_srh(fp, tuninfo->srh); in print_encap_seg6()
420 struct ipv6_sr_hdr *srh; in parse_srh() local
438 srh = malloc(srhlen); in parse_srh()
439 memset(srh, 0, srhlen); in parse_srh()
441 srh->hdrlen = (srhlen >> 3) - 1; in parse_srh()
442 srh->type = 4; in parse_srh()
443 srh->segments_left = nsegs - 1; in parse_srh()
444 srh->first_segment = nsegs - 1; in parse_srh()
447 srh->flags |= SR6_FLAG1_HMAC; in parse_srh()
449 i = srh->first_segment; in parse_srh()
451 inet_get_addr(s, NULL, &srh->segments[i]); in parse_srh()
458 tlv = (struct sr6_tlv_hmac *)((char *)srh + srhlen - 40); in parse_srh()
464 return srh; in parse_srh()
472 struct ipv6_sr_hdr *srh; in parse_encap_seg6() local
508 srh = parse_srh(segbuf, hmac, encap); in parse_encap_seg6()
509 srhlen = (srh->hdrlen + 1) << 3; in parse_encap_seg6()
516 memcpy(tuninfo->srh, srh, srhlen); in parse_encap_seg6()
522 free(srh); in parse_encap_seg6()
536 struct ipv6_sr_hdr *srh; in parse_encap_seg6local() local
625 srh = parse_srh(segbuf, hmac, in parse_encap_seg6local()
627 srhlen = (srh->hdrlen + 1) << 3; in parse_encap_seg6local()
628 rta_addattr_l(rta, len, SEG6_LOCAL_SRH, srh, srhlen); in parse_encap_seg6local()
629 free(srh); in parse_encap_seg6local()