icwmp/inc/backupSession.h
Mohamed Kallel 27b73d5af7 PIVA::DELIVERY 8
script optimization
Voice parameters: AddObject/DeleteObject
Voice parameters: Vendor specific parameter

Concerning what we did in the optimization task:
1)  The main script  (freecwmp) is loaded only 1 time during the session. the load is done just before the start of the session. the function scripts are loaded within the load of the main script (freecwmp) only one time. The old behaviour consist to load the main script (freecwmp) and the function scripts for each parameter treatment. Core code (C) and Scripts are changed
2) Optimize the preparing of inform message. old script take ~30s and now it takes ~2s. Core code (C) and Scripts are changed
3) Execute only the function related to the parameter. For example if the requested parameter is "InternetGatewayDevice.ManagementServer.URL" then the main script freecwmp will execute only the related function of this parameter which is get_management_server(). The old behaviour consist to execute all get functions: get_wan_device(), get_lan_device(), get_device_info()...
4) Minimize the size of the script files: Replace some blocks o othe source code by a functions
2013-07-24 16:05:32 +01:00

58 lines
1.9 KiB
C

/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2013 Inteno Broadband Technology AB
* Author Mohamed Kallel <mohamed.kallel@pivasoftware.com>
* Author Ahmed Zribi <ahmed.zribi@pivasoftware.com>
*
*/
#ifndef _BACKUPSESSION_H__
#define _BACKUPSESSION_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <microxml.h>
#include <unistd.h>
#include "xml.h"
#define RPC_NO_STATUS -1
#define RPC_QUEUE 0
#define RPC_SEND 1
# define CWMP_BACKUP_SESSION "<cwmp></cwmp>"
typedef enum backup_loading {
ALL,
ACS,
CR_IP
} backup_loading;
struct search_keywords {
char *name;
char *value;
};
extern pthread_mutex_t mutex_backup_session;
void bkp_session_save();
int cwmp_load_saved_session(struct cwmp *cwmp, char **acsurl, enum backup_loading load);
mxml_node_t *bkp_session_insert_event(int index, char *command_key, int id, char *status);
void bkp_session_delete_event(int id, char *status);
void bkp_session_insert_parameter(mxml_node_t *b, char *name);
void bkp_session_simple_insert(char *parent, char *child, char *value);
void bkp_session_move_inform_to_inform_send ();
void bkp_session_move_inform_to_inform_queue ();
void bkp_session_insert_schedule_inform(time_t schedule_time,char *command_key);
void bkp_session_delete_schedule_inform(time_t schedule_time,char *command_key);
void bkp_session_insert_download(struct download *pdownload);
void bkp_session_delete_download(struct download *pdownload);
void bkp_session_insert_transfer_complete(struct transfer_complete *ptransfer_complete);
void bkp_session_delete_transfer_complete(struct transfer_complete *ptransfer_complete);
#endif /* _BACKUPSESSION_H__ */