00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00021
00022
00233 #include <sync/common.h>
00234 #include "psd_config.h"
00235 #include "psd_server.h"
00236
00237 #include PS_OUT_H
00238 #include PS_SEQUENCE_H
00239
00240
00241
00245 #define DNAME_PSD "psd"
00246
00247
00248
00253 extern const parse_menu_t master_menu[];
00254
00255
00256
00265 static int
00266 psd_init(evContext ctx)
00267 {
00268 init_config();
00269 server_init(ctx);
00270 return SUCCESS;
00271 }
00272
00273
00274
00286 int
00287 main(int argc, char **argv)
00288 {
00289 int ret = 0;
00290 junos_sdk_app_ctx_t ctx;
00291 const char * psd_config[] = {DDLNAME_SYNC, DDLNAME_SYNC_PS, NULL};
00292
00293
00294 ctx = junos_create_app_ctx(argc, argv, DNAME_PSD,
00295 NULL, PACKAGE_NAME, SEQUENCE_NUMBER);
00296 if (ctx == NULL) {
00297 return -1;
00298 }
00299
00300
00301 if ((ret = junos_set_app_cb_init(ctx, psd_init))) {
00302 goto cleanup;
00303 }
00304
00305
00306 if ((ret = junos_set_app_cb_config_read(ctx, psd_config_read))) {
00307 goto cleanup;
00308 }
00309
00310
00311 if ((ret = junos_set_app_cfg_trace_path(ctx, psd_config)) < 0) {
00312 goto cleanup;
00313 }
00314
00315
00316 ret = junos_app_init(ctx);
00317
00318 cleanup:
00319
00320 junos_destroy_app_ctx(ctx);
00321 return ret;
00322 }