- char **nids = NULL;
- int num, rc;
- struct cYAML *seq_no, *prim_nid, *ip2nets, *peer_nis;
- char err_str[LNET_MAX_STR_LEN];
-
- seq_no = cYAML_get_object_item(tree, "seq_no");
- prim_nid = cYAML_get_object_item(tree, "primary nid");
- ip2nets = cYAML_get_object_item(tree, "ip2nets");
- peer_nis = cYAML_get_object_item(tree, "peer ni");
-
- if (ip2nets && (prim_nid || peer_nis)) {
- rc = LUSTRE_CFG_RC_BAD_PARAM;
- snprintf(err_str, sizeof(err_str),
- "ip2nets can not be specified along side prim_nid"
- " or peer ni fields");
- cYAML_build_error(rc, (seq_no) ? seq_no->cy_valueint : -1,
- DEL_CMD, "peer", err_str, err_rc);
- return rc;
- }
-
- num = yaml_copy_peer_nids((ip2nets) ? ip2nets : peer_nis , &nids,
- (prim_nid) ? prim_nid->cy_valuestring : NULL,
- true);
- if (num < 0) {
- snprintf(err_str, sizeof(err_str),
- "error copying nids from YAML block");
- cYAML_build_error(num, (seq_no) ? seq_no->cy_valueint : -1,
- ADD_CMD, "peer", err_str, err_rc);
- return num;
- }
-
- rc = lustre_lnet_del_peer_nid((prim_nid) ? prim_nid->cy_valuestring : NULL,
- nids, num, (ip2nets) ? true : false,
- (seq_no) ? seq_no->cy_valueint : -1,
- err_rc);
-
- yaml_free_string_array(nids, num);
- return rc;