Lines Matching refs:attr
99 u_int8_t *hashp = 0, *attrp, *attr; in cfg_initiator_send_ATTR() local
268 attr = attrp + off; in cfg_initiator_send_ATTR()
269 SET_ISAKMP_ATTR_TYPE(attr, bit); in cfg_initiator_send_ATTR()
279 SET_ISAKMP_ATTR_LENGTH_VALUE(attr, 4); in cfg_initiator_send_ATTR()
280 encode_32(attr + ISAKMP_ATTR_VALUE_OFF, life); in cfg_initiator_send_ATTR()
332 SET_ISAKMP_ATTR_LENGTH_VALUE(attr, length); in cfg_initiator_send_ATTR()
333 memcpy(attr + ISAKMP_ATTR_VALUE_OFF, in cfg_initiator_send_ATTR()
361 struct isakmp_cfg_attr *attr; in cfg_initiator_recv_ATTR() local
416 for (attr = LIST_FIRST(&ie->attrs); attr; in cfg_initiator_recv_ATTR()
417 attr = LIST_NEXT(attr, link)) in cfg_initiator_recv_ATTR()
422 attr->type))); in cfg_initiator_recv_ATTR()
439 for (attr = LIST_FIRST(&ie->attrs); attr; in cfg_initiator_recv_ATTR()
440 attr = LIST_NEXT(attr, link)) in cfg_initiator_recv_ATTR()
445 attr->type))); in cfg_initiator_recv_ATTR()
470 struct isakmp_cfg_attr *attr; in cfg_responder_recv_ATTR() local
511 for (attr = LIST_FIRST(&ie->attrs); attr; in cfg_responder_recv_ATTR()
512 attr = LIST_NEXT(attr, link)) in cfg_responder_recv_ATTR()
517 attr->type))); in cfg_responder_recv_ATTR()
698 struct isakmp_cfg_attr *attr; in cfg_decode_attribute() local
708 attr = calloc(1, sizeof *attr); in cfg_decode_attribute()
709 if (!attr) { in cfg_decode_attribute()
711 (unsigned long)sizeof *attr); in cfg_decode_attribute()
714 attr->type = type; in cfg_decode_attribute()
715 attr->length = len; in cfg_decode_attribute()
717 attr->value = malloc(len); in cfg_decode_attribute()
718 if (!attr->value) { in cfg_decode_attribute()
721 free(attr); in cfg_decode_attribute()
725 memcpy(attr->value, value, len); in cfg_decode_attribute()
727 LIST_INSERT_HEAD(&ie->attrs, attr, link); in cfg_decode_attribute()
738 struct isakmp_cfg_attr *attr; in cfg_encode_attributes() local
747 for (attr = LIST_FIRST(attrs); attr; attr = LIST_NEXT(attr, link)) { in cfg_encode_attributes()
749 if (type == ISAKMP_CFG_ACK && attr->attr_used == 0) in cfg_encode_attributes()
752 switch (attr->type) { in cfg_encode_attributes()
759 attr->length = 4; in cfg_encode_attributes()
763 attr->length = 8; in cfg_encode_attributes()
768 attr->length = 0; in cfg_encode_attributes()
772 attr->length = 2 * 15; in cfg_encode_attributes()
780 attr->length = 16; in cfg_encode_attributes()
784 attr->length = 17; in cfg_encode_attributes()
788 attr->ignore++; in cfg_encode_attributes()
791 *len += ISAKMP_ATTR_SZ + attr->length; in cfg_encode_attributes()
805 for (attr = LIST_FIRST(attrs); attr; attr = LIST_NEXT(attr, link)) { in cfg_encode_attributes()
807 if (type == ISAKMP_CFG_ACK && attr->attr_used == 0) in cfg_encode_attributes()
810 switch (attr->type) { in cfg_encode_attributes()
834 switch (attr->type) { in cfg_encode_attributes()
869 switch (attr->type) { in cfg_encode_attributes()
885 attr->length = 0; in cfg_encode_attributes()
896 attr->length = 0; in cfg_encode_attributes()
900 if (attr->type == ISAKMP_CFG_ATTR_INTERNAL_IP4_SUBNET) in cfg_encode_attributes()
901 attr->length = 4; in cfg_encode_attributes()
902 else if (attr->type == in cfg_encode_attributes()
904 attr->length = 16; in cfg_encode_attributes()
907 sockaddr_addrdata(sa), attr->length); in cfg_encode_attributes()
911 if (attr->type == in cfg_encode_attributes()
918 attr->length = 0; in cfg_encode_attributes()
926 attr->length = 0; in cfg_encode_attributes()
930 attr->length, sockaddr_addrdata(sa), in cfg_encode_attributes()
931 attr->length); in cfg_encode_attributes()
932 attr->length = 8; in cfg_encode_attributes()
934 } else if (attr->type == in cfg_encode_attributes()
942 attr->length = 0; in cfg_encode_attributes()
948 attr->length = 0; in cfg_encode_attributes()
953 attr->length = 17; in cfg_encode_attributes()
973 SET_ISAKMP_ATTR_TYPE(*attrp + off, attr->type); in cfg_encode_attributes()
974 SET_ISAKMP_ATTR_LENGTH_VALUE(*attrp + off, attr->length); in cfg_encode_attributes()
975 off += ISAKMP_ATTR_VALUE_OFF + attr->length; in cfg_encode_attributes()