/* Copyright (c) 2020 Roger Light All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 and Eclipse Distribution License v1.0 which accompany this distribution. The Eclipse Public License is available at https://www.eclipse.org/legal/epl-2.0/ and the Eclipse Distribution License is available at http://www.eclipse.org/org/documents/edl-v10.php. SPDX-License-Identifier: EPL-2.0 OR EDL-1.0 Contributors: Roger Light - initial implementation and documentation. */ #include #include #include #include #include "mosquitto.h" #include "mosquitto_ctrl.h" #include "get_password.h" #include "password_mosq.h" int dynsec_client__create(int argc, char *argv[], cJSON *j_command) { char *username = NULL, *password = NULL, *clientid = NULL; char prompt[200], verify_prompt[200]; char password_buf[200]; int rc; int i; bool request_password = true; if(argc == 0){ return MOSQ_ERR_INVAL; } username = argv[0]; for(i=1; i 0 && cJSON_AddIntToObject(j_command, "count", count) == NULL) || (offset > 0 && cJSON_AddIntToObject(j_command, "offset", offset) == NULL) ){ return MOSQ_ERR_NOMEM; }else{ return MOSQ_ERR_SUCCESS; } }