lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /************************************************************************
|
| 2 | * *
|
| 3 | * Netcwmp/Opencwmp Project *
|
| 4 | * A software client for enabling TR-069 in embedded devices (CPE). *
|
| 5 | * *
|
| 6 | * Copyright (C) 2013-2014 netcwmp.netcwmp group *
|
| 7 | * *
|
| 8 | * This program is free software; you can redistribute it and/or *
|
| 9 | * modify it under the terms of the GNU General Public License *
|
| 10 | * as published by the Free Software Foundation; either version 2 *
|
| 11 | * of the License, or (at your option) any later version. *
|
| 12 | * *
|
| 13 | * This program is distributed in the hope that it will be useful, *
|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 16 | * GNU General Public License for more details. *
|
| 17 | * *
|
| 18 | * You should have received a copy of the GNU Lesser General Public *
|
| 19 | * License along with this library; if not, write to the *
|
| 20 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, *
|
| 21 | * Boston, MA 02111-1307 USA *
|
| 22 | * *
|
| 23 | * Copyright 2013-2014 Mr.x(Mr.x) <netcwmp@gmail.com> *
|
| 24 | * *
|
| 25 | ***********************************************************************/
|
| 26 |
|
| 27 | #include "cwmp_module.h"
|
| 28 | #include <cwmp/cfg.h>
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 | void cwmp_conf_init(cwmp_t * cwmp)
|
| 33 | {
|
| 34 | pool_t * pool;
|
| 35 | FUNCTION_TRACE();
|
| 36 |
|
| 37 | pool = cwmp->pool;
|
| 38 | cwmp->httpd_port = cwmp_conf_get_int("cwmpd:httpd_port"); //cwmp_nvram_get_int("cwmp:httpd_port");
|
| 39 |
|
| 40 | cwmp->acs_auth = cwmp_conf_get_int("cwmp:acs_auth");
|
| 41 | cwmp->cpe_auth = cwmp_conf_get_int("cwmp:cpe_auth");
|
| 42 |
|
| 43 | if(cwmp->acs_auth)
|
| 44 | {
|
| 45 | cwmp->acs_user = cwmp_conf_pool_get(pool, "cwmp:acs_username");
|
| 46 | cwmp->acs_pwd = cwmp_conf_pool_get(pool, "cwmp:acs_password");
|
| 47 | }
|
| 48 |
|
| 49 | if(cwmp->cpe_auth)
|
| 50 | {
|
| 51 | cwmp->cpe_user = cwmp_conf_pool_get(pool, "cwmp:cpe_username");
|
| 52 | cwmp->cpe_pwd = cwmp_conf_pool_get(pool, "cwmp:cpe_password");
|
| 53 |
|
| 54 | }
|
| 55 |
|
| 56 | cwmp->acs_url = cwmp_conf_pool_get(pool, "cwmp:acs_url"); // "http://192.168.0.69:8000/otnms/acs/webservice.action";//cwmp_nvram_getdup(pool, "cwmp:acs_url");
|
| 57 |
|
| 58 | cwmp->cpe_mf = cwmp_conf_pool_get(pool, "cwmp:cpe_manufacture"); // "ZTE"; //cwmp_nvram_getdup(pool, "cwmp:cpe_manufacture");
|
| 59 |
|
| 60 | cwmp->cpe_oui = cwmp_conf_pool_get(pool, "cwmp:cpe_oui"); // "00D0D0";cwmp_nvram_getdup(pool, "cwmp:cpe_oui");
|
| 61 |
|
| 62 | cwmp->cpe_sn = cwmp_conf_pool_get(pool, "cwmp:cpe_sn"); // "0410400AA11AA2255"; //cwmp_nvram_getdup(pool, "cwmp:cpe_sn");
|
| 63 |
|
| 64 | cwmp->cpe_name = cwmp_conf_pool_get(pool, "cwmp:cpe_name"); // "00D0D0"; //cwmp_nvram_getdup(pool, "cwmp:cpe_name");
|
| 65 |
|
| 66 | cwmp->cpe_pc = cwmp_conf_pool_get(pool, "cwmp:cpe_pc"); // "ZXECS EBG2100";
|
| 67 |
|
| 68 | cwmp_log_debug("url:%s\nmf:%s\noui:%s\nsn:%s\nname:%s\npc:%s\nhttpd port:%d\n", cwmp->acs_url, cwmp->cpe_mf, cwmp->cpe_oui, cwmp->cpe_sn, cwmp->cpe_name, cwmp->cpe_pc,
|
| 69 | cwmp->httpd_port);
|
| 70 |
|
| 71 |
|
| 72 | cwmp->event_filename = cwmp_conf_pool_get(pool, "cwmp:event_filename");
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 | }
|
| 77 |
|