From 26c620fc4b791c9661c47508a34436f50e8c6641 Mon Sep 17 00:00:00 2001 From: Henning Westerholt Date: Mon, 15 Jul 2019 20:35:45 +0200 Subject: [PATCH] ims_registrar_pcscf: fix code formatting after merge 57961c9f --- .../ims_registrar_pcscf_mod.c | 100 +++++++++--------- src/modules/ims_registrar_pcscf/save.c | 44 ++++---- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c b/src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c index 18dd7a79725..8eb3c7b4a4b 100644 --- a/src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c +++ b/src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c @@ -81,9 +81,9 @@ int publish_reginfo = 0; int subscribe_to_reginfo = 0; int subscription_expires = 3600; int ignore_reg_state = 0; -int ignore_contact_rxport_check = 0; /**!< ignore port checks between received port on message and -registration received port. - * this is useful for example if you register with UDP but possibly send invite over TCP (message too big)*/ +/**!< ignore port checks between received port on message and registration received port. + * this is useful for example if you register with UDP but possibly send invite over TCP (message too big) */ +int ignore_contact_rxport_check = 0; time_t time_now; @@ -94,7 +94,7 @@ unsigned int pending_reg_expires = 30; /**!< parameter for expiry time of a pe int is_registered_fallback2ip = 0; -int reginfo_queue_size_threshold = 0; /**Threshold for size of reginfo queue after which a warning is logged */ +int reginfo_queue_size_threshold = 0; /**Threshold for size of reginfo queue after which a warning is logged */ char* rcv_avp_param = 0; @@ -150,7 +150,7 @@ static cmd_export_t cmds[] = { {"pcscf_assert_identity", (cmd_function)w_assert_identity, 2, assert_identity_fixup, 0,REQUEST_ROUTE }, {"pcscf_assert_called_identity",(cmd_function)w_assert_called_identity, 1, assert_identity_fixup, 0,ONREPLY_ROUTE }, {"reginfo_handle_notify", (cmd_function)w_reginfo_handle_notify, 1, domain_fixup, 0,REQUEST_ROUTE}, - {"pcscf_unregister", (cmd_function)w_unregister, 4, unregister_fixup, 0,ANY_ROUTE}, + {"pcscf_unregister", (cmd_function)w_unregister, 4, unregister_fixup, 0,ANY_ROUTE}, {0, 0, 0, 0, 0, 0} }; @@ -164,10 +164,10 @@ static param_export_t params[] = { {"received_avp", PARAM_STR, &rcv_avp_param }, {"is_registered_fallback2ip", INT_PARAM, &is_registered_fallback2ip }, {"publish_reginfo", INT_PARAM, &publish_reginfo }, - {"subscribe_to_reginfo", INT_PARAM, &subscribe_to_reginfo }, - {"subscription_expires", INT_PARAM, &subscription_expires }, - {"ignore_contact_rxport_check", INT_PARAM, &ignore_contact_rxport_check }, - {"ignore_reg_state", INT_PARAM, &ignore_reg_state }, + {"subscribe_to_reginfo", INT_PARAM, &subscribe_to_reginfo }, + {"subscription_expires", INT_PARAM, &subscription_expires }, + {"ignore_contact_rxport_check", INT_PARAM, &ignore_contact_rxport_check }, + {"ignore_reg_state", INT_PARAM, &ignore_reg_state }, {"force_icscf_uri", PARAM_STR, &force_icscf_uri }, {"reginfo_queue_size_threshold", INT_PARAM, ®info_queue_size_threshold }, // {"store_profile_dereg", INT_PARAM, &store_data_on_dereg}, @@ -177,11 +177,11 @@ static param_export_t params[] = { static pv_export_t mod_pvs[] = { - {{"pcscf_asserted_identity", (sizeof("pcscf_asserted_identity")-1)}, /* The first identity of the contact. */ - PVT_OTHER, pv_get_asserted_identity_f, 0, 0, 0, 0, 0}, - {{"pcscf_registration_contact", (sizeof("pcscf_registration_contact")-1)}, /* The contact used during REGISTER */ - PVT_OTHER, pv_get_registration_contact_f, 0, 0, 0, 0, 0}, - {{0, 0}, 0, 0, 0, 0, 0, 0, 0} + {{"pcscf_asserted_identity", (sizeof("pcscf_asserted_identity")-1)}, /* The first identity of the contact. */ + PVT_OTHER, pv_get_asserted_identity_f, 0, 0, 0, 0, 0}, + {{"pcscf_registration_contact", (sizeof("pcscf_registration_contact")-1)}, /* The contact used during REGISTER */ + PVT_OTHER, pv_get_registration_contact_f, 0, 0, 0, 0, 0}, + {{0, 0}, 0, 0, 0, 0, 0, 0, 0} }; /*! \brief @@ -274,39 +274,39 @@ static int mod_init(void) { } LM_INFO("Successfully bound to PCSCF IPSEC module\n"); - if(subscribe_to_reginfo == 1){ - /* Bind to PUA: */ - bind_pua = (bind_pua_t) find_export("bind_pua", 1, 0); - if (!bind_pua) { - LM_ERR("Can't bind pua\n"); - return -1; - } - if (bind_pua(&pua) < 0) { - LM_ERR("Can't bind pua\n"); - return -1; - } - /* Check for Publish/Subscribe methods */ - if (pua.send_publish == NULL) { - LM_ERR("Could not import send_publish\n"); - return -1; - } - if (pua.send_subscribe == NULL) { - LM_ERR("Could not import send_subscribe\n"); - return -1; - } - if (pua.get_subs_list == NULL) { - LM_ERR("Could not import get_subs_list\n"); - return -1; - } - LM_DBG("Successfully bound to PUA module\n"); - - /*init cdb cb event list*/ + if(subscribe_to_reginfo == 1){ + /* Bind to PUA: */ + bind_pua = (bind_pua_t) find_export("bind_pua", 1, 0); + if (!bind_pua) { + LM_ERR("Can't bind pua\n"); + return -1; + } + if (bind_pua(&pua) < 0) { + LM_ERR("Can't bind pua\n"); + return -1; + } + /* Check for Publish/Subscribe methods */ + if (pua.send_publish == NULL) { + LM_ERR("Could not import send_publish\n"); + return -1; + } + if (pua.send_subscribe == NULL) { + LM_ERR("Could not import send_subscribe\n"); + return -1; + } + if (pua.get_subs_list == NULL) { + LM_ERR("Could not import get_subs_list\n"); + return -1; + } + LM_DBG("Successfully bound to PUA module\n"); + + /*init cdb cb event list*/ if (!init_reginfo_event_list()) { LM_ERR("unable to initialise reginfo_event_list\n"); return -1; } - LM_DBG("Successfully initialised reginfo_event_list\n"); - } + LM_DBG("Successfully initialised reginfo_event_list\n"); + } return 0; @@ -323,15 +323,15 @@ static int child_init(int rank) { LM_DBG("Initialization of module in child [%d] \n", rank); - if ((subscribe_to_reginfo == 1) && (rank == PROC_MAIN)) { - LM_DBG("Creating RegInfo Event Processor process\n"); + if ((subscribe_to_reginfo == 1) && (rank == PROC_MAIN)) { + LM_DBG("Creating RegInfo Event Processor process\n"); int pid = fork_process(PROC_SIPINIT, "RegInfo Event Processor", 1); if (pid < 0) - return -1; //error + return -1; //error if (pid == 0) { - if (cfg_child_init()) - return -1; //error - reginfo_event_process(); + if (cfg_child_init()) + return -1; //error + reginfo_event_process(); } } @@ -373,7 +373,7 @@ static int save_fixup2(void** param, int param_no) if (param_no == 1) { return domain_fixup(param,param_no); } - return 0; + return 0; } /*! \brief diff --git a/src/modules/ims_registrar_pcscf/save.c b/src/modules/ims_registrar_pcscf/save.c index 5a7b03100b1..97734771312 100644 --- a/src/modules/ims_registrar_pcscf/save.c +++ b/src/modules/ims_registrar_pcscf/save.c @@ -65,7 +65,7 @@ extern ipsec_pcscf_api_t ipsec_pcscf; struct sip_msg* get_request_from_reply(struct sip_msg* reply) { - struct cell *t; + struct cell *t; t = tmb.t_gett(); if (!t || t == (void*) -1) { LM_ERR("Reply without transaction\n"); @@ -91,7 +91,7 @@ struct sip_msg* get_request_from_reply(struct sip_msg* reply) */ static inline int calc_contact_expires(contact_t *c,int expires_hdr, int local_time_now) { - unsigned int r = 0; + unsigned int r = 0; if (expires_hdr >= 0) r = expires_hdr; @@ -264,17 +264,17 @@ int save_pending(struct sip_msg* _m, udomain_t* _d) { pcontact_t* pcontact; contact_t* c; struct pcontact_info ci; - struct via_body* vb; - unsigned short port, proto; + struct via_body* vb; + unsigned short port, proto; int_str val; struct sip_uri parsed_received; char srcip[50]; memset(&ci, 0, sizeof(struct pcontact_info)); - vb = cscf_get_ue_via(_m); - port = vb->port?vb->port:5060; - proto = vb->proto; + vb = cscf_get_ue_via(_m); + port = vb->port?vb->port:5060; + proto = vb->proto; cb = cscf_parse_contacts(_m); if (!cb || (!cb->contacts)) { @@ -282,7 +282,7 @@ int save_pending(struct sip_msg* _m, udomain_t* _d) { goto error; } - c = cb->contacts; + c = cb->contacts; //TODO: need support for multiple contacts - currently assume one contact //make sure this is not a de-registration int expires_hdr = cscf_get_expires_hdr(_m, 0); @@ -309,15 +309,15 @@ int save_pending(struct sip_msg* _m, udomain_t* _d) { LM_DBG("contact requesting to expire in %d seconds\n", expires-local_time_now); /*populate CI with bare minimum*/ - ci.via_host = vb->host; - ci.via_port = port; - ci.via_prot = proto; - ci.aor = c->uri; + ci.via_host = vb->host; + ci.via_port = port; + ci.via_prot = proto; + ci.aor = c->uri; ci.num_public_ids=0; ci.num_service_routes=0; ci.expires=local_time_now + pending_reg_expires; ci.reg_state=PCONTACT_ANY; - ci.searchflag=SEARCH_RECEIVED; //we want to make sure we are very specific with this search to make sure we get the correct contact to put into reg_pending. + ci.searchflag=SEARCH_RECEIVED; //we want to make sure we are very specific with this search to make sure we get the correct contact to put into reg_pending. // Received Info: First try AVP, otherwise simply take the source of the request: memset(&val, 0, sizeof(int_str)); @@ -347,17 +347,17 @@ int save_pending(struct sip_msg* _m, udomain_t* _d) { if (ci.received_port == 0) ci.received_port = 5060; - // Parse security parameters - security_t* sec_params = NULL; - if((sec_params = cscf_get_security(_m)) == NULL) { - LM_DBG("Will save pending contact without security parameters\n"); - } + // Parse security parameters + security_t* sec_params = NULL; + if((sec_params = cscf_get_security(_m)) == NULL) { + LM_DBG("Will save pending contact without security parameters\n"); + } // Parse security-verify parameters - security_t* sec_verify_params = NULL; - if((sec_verify_params = cscf_get_security_verify(_m)) == NULL){ - LM_DBG("Will save pending contact without security-verify parameters\n"); - }else{ + security_t* sec_verify_params = NULL; + if((sec_verify_params = cscf_get_security_verify(_m)) == NULL){ + LM_DBG("Will save pending contact without security-verify parameters\n"); + }else{ if(sec_params){ // for REGISTER request try to set spi pc and spi ps from security-verify header sec_params->data.ipsec->spi_ps = sec_verify_params->data.ipsec->spi_us;