code: func (h *Handle) XfrmStateList(family int) ([]XfrmState, error) {
  	req := h.newNetlinkRequest(nl.XFRM_MSG_GETSA, unix.NLM_F_DUMP)
  
  	msgs, err := req.Execute(unix.NETLINK_XFRM, nl.XFRM_MSG_NEWSA)
  	if err != nil {
  		return nil, err
  	}
  
  	var res []XfrmState
  	for _, m := range msgs {
  		if state, err := parseXfrmState(m, family); err == nil {
  			res = append(res, *state)
  		} else if err == familyError {
  			continue
  		} else {
  			return nil, err
  		}
  	}
  	return res, nil
  }
docs: // XfrmStateList gets a list of xfrm states in the system.
  // Equivalent to: `ip xfrm state show`.
  // The list can be filtered by ip family.