2019-04-27 14:54:30 +00:00
|
|
|
#include "app/context.h"
|
|
|
|
#include "app/application.h"
|
2018-08-14 08:28:22 +00:00
|
|
|
|
|
|
|
#include "app_init.h"
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
extern int __pgw_log_domain;
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
#undef OGS_LOG_DOMAIN
|
|
|
|
#define OGS_LOG_DOMAIN __pgw_log_domain
|
2018-08-14 08:01:46 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int app_initialize(app_param_t *param)
|
|
|
|
{
|
|
|
|
int rv;
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
param->name = "pgw";
|
|
|
|
rv = app_will_initialize(param);
|
|
|
|
if (rv != OGS_OK) return rv;
|
2017-08-04 03:06:56 +00:00
|
|
|
|
2017-07-11 10:16:45 +00:00
|
|
|
rv = pgw_initialize();
|
2019-04-27 14:54:30 +00:00
|
|
|
if (rv != OGS_OK)
|
2018-02-10 08:08:51 +00:00
|
|
|
{
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_error("Failed to intialize PGW");
|
2018-02-10 08:08:51 +00:00
|
|
|
return rv;
|
|
|
|
}
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_info("PGW initialize...done");
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2017-10-29 11:48:17 +00:00
|
|
|
rv = app_did_initialize();
|
2019-04-27 14:54:30 +00:00
|
|
|
if (rv != OGS_OK) return rv;
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
return OGS_OK;
|
2017-07-11 10:16:45 +00:00
|
|
|
}
|
|
|
|
|
2017-07-11 14:38:52 +00:00
|
|
|
void app_terminate(void)
|
2017-07-11 10:16:45 +00:00
|
|
|
{
|
2017-07-11 14:38:52 +00:00
|
|
|
app_will_terminate();
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_info("PGW try to terminate");
|
2017-07-11 10:16:45 +00:00
|
|
|
pgw_terminate();
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_info("PGW terminate...done");
|
2017-07-11 10:16:45 +00:00
|
|
|
|
2017-07-11 14:38:52 +00:00
|
|
|
app_did_terminate();
|
2017-07-11 10:16:45 +00:00
|
|
|
}
|