code: func (h *Handle) XfrmPolicyList(family int) ([]XfrmPolicy, error) {
  	req := h.newNetlinkRequest(nl.XFRM_MSG_GETPOLICY, unix.NLM_F_DUMP)
  
  	msg := nl.NewIfInfomsg(family)
  	req.AddData(msg)
  
  	msgs, err := req.Execute(unix.NETLINK_XFRM, nl.XFRM_MSG_NEWPOLICY)
  	if err != nil {
  		return nil, err
  	}
  
  	var res []XfrmPolicy
  	for _, m := range msgs {
  		if policy, err := parseXfrmPolicy(m, family); err == nil {
  			res = append(res, *policy)
  		} else if err == familyError {
  			continue
  		} else {
  			return nil, err
  		}
  	}
  	return res, nil
  }
docs: // XfrmPolicyList gets a list of xfrm policies in the system.
  // Equivalent to: `ip xfrm policy show`.
  // The list can be filtered by ip family.