本文整理汇总了C++中LOGP函数的典型用法代码示例。如果您正苦于以下问题:C++ LOGP函数的具体用法?C++ LOGP怎么用?C++ LOGP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOGP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: trx_ctrl_timer_cb
/* send first ctrl message and start timer */
static void trx_ctrl_timer_cb(void *data)
{
struct trx_l1h *l1h = data;
LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for trx=%d\n",
l1h->trx->nr);
trx_ctrl_send(l1h);
}
开发者ID:jemmy655,项目名称:osmo,代码行数:10,代码来源:trx_if.c
示例2: mgcp_analyze_header
int mgcp_analyze_header(struct mgcp_config *cfg, struct msgb *msg,
struct mgcp_msg_ptr *ptr, int size,
const char **transaction_id, struct mgcp_endpoint **endp)
{
int found;
*transaction_id = "000000";
if (size < 3) {
LOGP(DMGCP, LOGL_ERROR, "Not enough space in ptr\n");
return -1;
}
found = find_msg_pointers(msg, ptr, size);
if (found <= 3) {
LOGP(DMGCP, LOGL_ERROR, "Gateway: Not enough params. Found: %d\n", found);
return -1;
}
/*
* replace the space with \0. the main method gurantess that
* we still have + 1 for null termination
*/
msg->l3h[ptr[3].start + ptr[3].length + 1] = '\0';
msg->l3h[ptr[2].start + ptr[2].length + 1] = '\0';
msg->l3h[ptr[1].start + ptr[1].length + 1] = '\0';
msg->l3h[ptr[0].start + ptr[0].length + 1] = '\0';
if (strncmp("1.0", (const char *)&msg->l3h[ptr[3].start], 3) != 0
|| strncmp("MGCP", (const char *)&msg->l3h[ptr[2].start], 4) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Wrong MGCP version. Not handling: '%s' '%s'\n",
(const char *)&msg->l3h[ptr[3].start],
(const char *)&msg->l3h[ptr[2].start]);
return -1;
}
*transaction_id = (const char *)&msg->l3h[ptr[0].start];
if (endp) {
*endp = find_endpoint(cfg, (const char *)&msg->l3h[ptr[1].start]);
return *endp == NULL;
}
return 0;
}
开发者ID:jonathanrsantos,项目名称:opensgsn,代码行数:44,代码来源:mgcp_protocol.c
示例3: bind_rtp
static int bind_rtp(struct mgcp_config *cfg, struct mgcp_rtp_end *rtp_end, int endpno)
{
if (create_bind(cfg->source_addr, &rtp_end->rtp, rtp_end->local_port) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to create RTP port: %s:%d on 0x%x\n",
cfg->source_addr, rtp_end->local_port, endpno);
goto cleanup0;
}
if (create_bind(cfg->source_addr, &rtp_end->rtcp, rtp_end->local_port + 1) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to create RTCP port: %s:%d on 0x%x\n",
cfg->source_addr, rtp_end->local_port + 1, endpno);
goto cleanup1;
}
set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp);
set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp);
rtp_end->rtp.when = BSC_FD_READ;
if (osmo_fd_register(&rtp_end->rtp) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to register RTP port %d on 0x%x\n",
rtp_end->local_port, endpno);
goto cleanup2;
}
rtp_end->rtcp.when = BSC_FD_READ;
if (osmo_fd_register(&rtp_end->rtcp) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to register RTCP port %d on 0x%x\n",
rtp_end->local_port + 1, endpno);
goto cleanup3;
}
return 0;
cleanup3:
osmo_fd_unregister(&rtp_end->rtp);
cleanup2:
close(rtp_end->rtcp.fd);
rtp_end->rtcp.fd = -1;
cleanup1:
close(rtp_end->rtp.fd);
rtp_end->rtp.fd = -1;
cleanup0:
return -1;
}
开发者ID:shimaore,项目名称:openbsc,代码行数:44,代码来源:mgcp_network.c
示例4: handle_page_resp
/* we will need to stop the paging request */
static int handle_page_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
struct gsm48_hdr *gh;
struct gsm48_pag_resp *resp;
struct gsm_subscriber *subscr;
if (msgb_l3len(msg) < sizeof(*gh) + sizeof(*resp)) {
LOGP(DMSC, LOGL_ERROR, "PagingResponse too small: %u\n", msgb_l3len(msg));
return -1;
}
gh = msgb_l3(msg);
resp = (struct gsm48_pag_resp *) &gh->data[0];
gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh),
mi_string, &mi_type);
DEBUGP(DRR, "PAGING RESPONSE: mi_type=0x%02x MI(%s)\n",
mi_type, mi_string);
switch (mi_type) {
case GSM_MI_TYPE_TMSI:
subscr = subscr_active_by_tmsi(conn->bts->network,
tmsi_from_string(mi_string));
break;
case GSM_MI_TYPE_IMSI:
subscr = subscr_active_by_imsi(conn->bts->network, mi_string);
break;
default:
subscr = NULL;
break;
}
if (!subscr) {
LOGP(DMSC, LOGL_ERROR, "Non active subscriber got paged.\n");
return -1;
}
paging_request_stop(conn->bts, subscr, conn, msg);
subscr_put(subscr);
return 0;
}
开发者ID:YBouzid,项目名称:openbsc,代码行数:44,代码来源:osmo_bsc_filter.c
示例5: echo_conf
/* Confirmation of an GTP ECHO request */
static int echo_conf(struct pdp_t *pdp, void *cbp, int recovery)
{
if (recovery < 0) {
LOGP(DGPRS, LOGL_NOTICE, "GTP Echo Request timed out\n");
/* FIXME: if version == 1, retry with version 0 */
} else {
DEBUGP(DGPRS, "GTP Rx Echo Response\n");
}
return 0;
}
开发者ID:git3389,项目名称:openbsc,代码行数:11,代码来源:sgsn_libgtp.c
示例6: LOGP
void BasicDebug::debug( double init_value ) {
if (init_value >= 0.0) {
SEQUENCE = init_value;
}
#ifdef DEBUG_TO_LOG
LOGP(TO_STRING(SEQUENCE++));
#else
std::cout << SEQUENCE++ << std::endl;
#endif
}
开发者ID:jcrada,项目名称:jcrada-creatures,代码行数:10,代码来源:BasicDebug.cpp
示例7: forward_ussd
static int forward_ussd(struct sccp_connections *con, const struct ussd_request *req,
struct msgb *input)
{
struct msgb *msg, *copy;
struct ipac_msgt_sccp_state *state;
struct bsc_nat_ussd_con *ussd;
if (!con->bsc->nat->ussd_con)
return -1;
msg = msgb_alloc_headroom(4096, 128, "forward ussd");
if (!msg) {
LOGP(DNAT, LOGL_ERROR, "Allocation failed, not forwarding.\n");
return -1;
}
copy = msgb_alloc_headroom(4096, 128, "forward bts");
if (!copy) {
LOGP(DNAT, LOGL_ERROR, "Allocation failed, not forwarding.\n");
msgb_free(msg);
return -1;
}
copy->l2h = msgb_put(copy, msgb_l2len(input));
memcpy(copy->l2h, input->l2h, msgb_l2len(input));
msg->l2h = msgb_put(msg, 1);
msg->l2h[0] = IPAC_MSGT_SCCP_OLD;
/* fill out the data */
state = (struct ipac_msgt_sccp_state *) msgb_put(msg, sizeof(*state));
state->trans_id = req->transaction_id;
state->invoke_id = req->invoke_id;
memcpy(&state->src_ref, &con->remote_ref, sizeof(con->remote_ref));
memcpy(&state->dst_ref, &con->real_ref, sizeof(con->real_ref));
memcpy(state->imsi, con->imsi, strlen(con->imsi));
ussd = con->bsc->nat->ussd_con;
bsc_do_write(&ussd->queue, msg, IPAC_PROTO_IPACCESS);
bsc_do_write(&ussd->queue, copy, IPAC_PROTO_SCCP);
return 0;
}
开发者ID:jonathanrsantos,项目名称:opensgsn,代码行数:43,代码来源:bsc_ussd.c
示例8: handle_chan_nack
static void handle_chan_nack(struct gsm_subscriber_connection *conn,
struct bsc_api *api, struct gsm_lchan *lchan)
{
if (conn->secondary_lchan != lchan)
return;
LOGP(DMSC, LOGL_ERROR, "Channel activation failed. Waiting for timeout now\n");
conn->secondary_lchan->conn = NULL;
conn->secondary_lchan = NULL;
}
开发者ID:YBouzid,项目名称:openbsc,代码行数:10,代码来源:bsc_api.c
示例9: l1ctl_sock_accept_cb
/* called for the master (listening) socket of the instance, allocates a new client */
static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what)
{
struct l1ctl_sock_inst *lsi = ofd->data;
struct l1ctl_sock_client *lsc;
int fd, rc;
fd = accept(ofd->fd, NULL, NULL);
if (fd < 0) {
LOGP(DL1C, LOGL_ERROR, "Failed to accept connection to l2.\n");
return -1;
}
lsc = talloc_zero(lsi, struct l1ctl_sock_client);
if (!lsc) {
close(fd);
LOGP(DL1C, LOGL_ERROR, "Failed to allocate L1CTL client\n");
return -1;
}
lsc->l1ctl_sock = lsi;
lsc->ofd.fd = fd;
lsc->ofd.when = BSC_FD_READ;
lsc->ofd.cb = l1ctl_sock_data_cb;
lsc->ofd.data = lsc;
if (lsi->accept_cb) {
rc = lsi->accept_cb(lsc);
if (rc < 0) {
talloc_free(lsc);
close(fd);
return rc;
}
}
LOGP(DL1C, LOGL_INFO, "Accepted client (fd=%u) from server (fd=%u)\n", fd, ofd->fd);
if (osmo_fd_register(&lsc->ofd) != 0) {
LOGP(DL1C, LOGL_ERROR, "Failed to register the l2 connection fd.\n");
talloc_free(lsc);
return -1;
}
llist_add_tail(&lsc->list, &lsi->clients);
return 0;
}
开发者ID:QNewU,项目名称:osmocom-bb,代码行数:44,代码来源:l1ctl_sock.c
示例10: paging_si_update
int paging_si_update(struct paging_state *ps, struct gsm48_control_channel_descr *chan_desc)
{
LOGP(DPAG, LOGL_INFO, "Paging SI update\n");
ps->chan_desc = *chan_desc;
/* FIXME: do we need to re-sort the old paging_records? */
return 0;
}
开发者ID:osmocom,项目名称:osmo-bts,代码行数:10,代码来源:paging.c
示例11: gsm411_rl_report_req
static int gsm411_rl_report_req(struct gsm411_smr_inst *inst, struct msgb *msg)
{
LOGP(DLSMS, LOGL_DEBUG,
SMR_LOG_STR "TX SMS REPORT\n", inst->id);
new_rp_state(inst, GSM411_RPS_IDLE);
inst->mn_send(inst, GSM411_MNSMS_DATA_REQ, msg);
gsm411_send_release(inst);
return 0;
}
开发者ID:84danielwhite,项目名称:libosmocore,代码行数:10,代码来源:gsm0411_smr.c
示例12: imm_ass
/* 9.1.18 IMMEDIATE ASSIGNMENT is received */
static int imm_ass(struct osmocom_ms *ms, struct msgb *msg)
{
struct gsm48_imm_ass *ia = msgb_l3(msg);
LOGP(DRR, LOGL_INFO, "IMMEDIATE ASSIGNMENT:\n");
if (state != SCAN_STATE_RACH) {
LOGP(DRR, LOGL_INFO, "Not for us, no request.\n");
return 0;
}
/* request ref */
if (match_ra(ms, &ia->req_ref)) {
return ta_result(ia->timing_advance);
}
LOGP(DRR, LOGL_INFO, "Request, but not for us.\n");
return 0;
}
开发者ID:0x7678,项目名称:Typhon-imsiCatcher-Catcher,代码行数:20,代码来源:cell_log.c
示例13: rcv_cch
static int rcv_cch(struct osmocom_ms *ms, struct msgb *msg)
{
struct abis_rsl_cchan_hdr *ch = msgb_l2(msg);
int msg_type = ch->c.msg_type;
int rc;
LOGP(DRSL, LOGL_INFO, "Received '%s' from layer1\n",
rsl_msg_name(msg_type));
if (state == SCAN_STATE_RACH && msg_type == RSL_MT_CHAN_CONF) {
rc = chan_conf(ms, msg);
msgb_free(msg);
return rc;
}
LOGP(DRSL, LOGL_NOTICE, "RSLms message unhandled\n");
msgb_free(msg);
return 0;
}
开发者ID:0x7678,项目名称:Typhon-imsiCatcher-Catcher,代码行数:19,代码来源:cell_log.c
示例14: rsl_rll_error
static int rsl_rll_error(uint8_t cause, struct lapdm_msg_ctx *mctx)
{
struct msgb *msg;
LOGP(DLLAPD, LOGL_NOTICE, "sending MDL-ERROR-IND %d\n", cause);
msg = rsl_rll_simple(RSL_MT_ERROR_IND, mctx->chan_nr, mctx->link_id, 1);
msg->l2h = msgb_put(msg, sizeof(struct abis_rsl_rll_hdr));
msgb_tlv_put(msg, RSL_IE_RLM_CAUSE, 1, &cause);
return rslms_sendmsg(msg, mctx->dl->entity);
}
开发者ID:0x7678,项目名称:Typhon-imsiCatcher-Catcher,代码行数:10,代码来源:lapdm.c
示例15: gsm411_mnsms_error_ind_tx
static int gsm411_mnsms_error_ind_tx(struct gsm411_smr_inst *inst,
struct msgb *msg)
{
LOGP(DLSMS, LOGL_DEBUG,
SMR_LOG_STR "TX SMS MNSMS-ERROR-IND\n", inst->id);
new_rp_state(inst, GSM411_RPS_IDLE);
inst->rl_recv(inst, GSM411_SM_RL_REPORT_IND, msg);
gsm411_send_release(inst);
return 0;
}
开发者ID:84danielwhite,项目名称:libosmocore,代码行数:10,代码来源:gsm0411_smr.c
示例16: gsm411_mmsms_est_cnf
static int gsm411_mmsms_est_cnf(struct gsm411_smc_inst *inst, struct msgb *msg)
{
if (!inst->cp_msg) {
LOGP(DLSMS, LOGL_FATAL, "EST CNF, but we have no cp_msg. This "
"should never happen, please fix!\n");
return -EINVAL;
}
return gsm411_mmsms_send_msg(inst);
}
开发者ID:0x7678,项目名称:Typhon-imsiCatcher-Catcher,代码行数:10,代码来源:gsm0411_smc.c
示例17: telnet_init
/*! \brief Initialize telnet based VTY interface
* \param[in] tall_ctx \ref talloc context
* \param[in] priv private data to be passed to callback
* \param[in] port UDP port number
*/
int telnet_init(void *tall_ctx, void *priv, int port)
{
struct sockaddr_in sock_addr;
int fd, rc, on = 1;
tall_telnet_ctx = talloc_named_const(tall_ctx, 1,
"telnet_connection");
/* FIXME: use new socket.c code of libosmocore */
fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (fd < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface socket creation failed\n");
return fd;
}
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = htons(port);
sock_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
rc = bind(fd, (struct sockaddr*)&sock_addr, sizeof(sock_addr));
if (rc < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface failed to bind\n");
close(fd);
return rc;
}
rc = listen(fd, 0);
if (rc < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface failed to listen\n");
close(fd);
return rc;
}
server_socket.data = priv;
server_socket.fd = fd;
osmo_fd_register(&server_socket);
return 0;
}
开发者ID:jonathanrsantos,项目名称:libosmocore,代码行数:48,代码来源:telnet_interface.c
示例18: gsm411_rl_data_req
static int gsm411_rl_data_req(struct gsm411_smr_inst *inst, struct msgb *msg)
{
LOGP(DLSMS, LOGL_DEBUG,
SMR_LOG_STR "TX SMS RP-DATA\n", inst->id);
/* start TR1N and enter 'wait for RP-ACK state' */
osmo_timer_schedule(&inst->rp_timer, GSM411_TMR_TR1M);
new_rp_state(inst, GSM411_RPS_WAIT_FOR_RP_ACK);
return inst->mn_send(inst, GSM411_MNSMS_EST_REQ, msg);
}
开发者ID:84danielwhite,项目名称:libosmocore,代码行数:10,代码来源:gsm0411_smr.c
示例19: ussd_read_cb
static int ussd_read_cb(struct osmo_fd *bfd)
{
struct bsc_nat_ussd_con *conn = bfd->data;
struct msgb *msg;
struct ipaccess_head *hh;
int ret;
ret = ipa_msg_recv(bfd->fd, &msg);
if (ret <= 0) {
LOGP(DNAT, LOGL_ERROR, "USSD Connection was lost.\n");
bsc_nat_ussd_destroy(conn);
return -1;
}
LOGP(DNAT, LOGL_NOTICE, "MSG from USSD: %s proto: %d\n",
osmo_hexdump(msg->data, msg->len), msg->l2h[0]);
hh = (struct ipaccess_head *) msg->data;
if (hh->proto == IPAC_PROTO_IPACCESS) {
if (msg->l2h[0] == IPAC_MSGT_ID_RESP) {
struct tlv_parsed tvp;
int ret;
ret = ipaccess_idtag_parse(&tvp,
(unsigned char *) msg->l2h + 2,
msgb_l2len(msg) - 2);
if (ret < 0) {
LOGP(DNAT, LOGL_ERROR, "ignoring IPA response "
"message with malformed TLVs\n");
return ret;
}
if (TLVP_PRESENT(&tvp, IPAC_IDTAG_UNITNAME))
ussd_auth_con(&tvp, conn);
}
msgb_free(msg);
} else if (hh->proto == IPAC_PROTO_SCCP) {
forward_sccp(conn->nat, msg);
} else {
msgb_free(msg);
}
return 0;
}
开发者ID:YBouzid,项目名称:openbsc,代码行数:43,代码来源:bsc_ussd.c
示例20: sgsn_gtp_init
int sgsn_gtp_init(struct sgsn_instance *sgi)
{
int rc;
struct gsn_t *gsn;
rc = gtp_new(&sgi->gsn, sgi->cfg.gtp_statedir,
&sgi->cfg.gtp_listenaddr.sin_addr, GTP_MODE_SGSN);
if (rc) {
LOGP(DGPRS, LOGL_ERROR, "Failed to create GTP: %d\n", rc);
return rc;
}
gsn = sgi->gsn;
sgi->gtp_fd0.fd = gsn->fd0;
sgi->gtp_fd0.priv_nr = 0;
sgi->gtp_fd0.data = sgi;
sgi->gtp_fd0.when = BSC_FD_READ;
sgi->gtp_fd0.cb = sgsn_gtp_fd_cb;
rc = osmo_fd_register(&sgi->gtp_fd0);
if (rc < 0)
return rc;
sgi->gtp_fd1c.fd = gsn->fd1c;
sgi->gtp_fd1c.priv_nr = 1;
sgi->gtp_fd1c.data = sgi;
sgi->gtp_fd1c.when = BSC_FD_READ;
sgi->gtp_fd1c.cb = sgsn_gtp_fd_cb;
osmo_fd_register(&sgi->gtp_fd1c);
if (rc < 0)
return rc;
sgi->gtp_fd1u.fd = gsn->fd1u;
sgi->gtp_fd1u.priv_nr = 2;
sgi->gtp_fd1u.data = sgi;
sgi->gtp_fd1u.when = BSC_FD_READ;
sgi->gtp_fd1u.cb = sgsn_gtp_fd_cb;
osmo_fd_register(&sgi->gtp_fd1u);
if (rc < 0)
return rc;
/* Start GTP re-transmission timer */
sgi->gtp_timer.cb = sgsn_gtp_tmr_cb;
sgi->gtp_timer.data = sgi;
sgsn_gtp_tmr_start(sgi);
/* Register callbackcs with libgtp */
gtp_set_cb_delete_context(gsn, cb_delete_context);
gtp_set_cb_conf(gsn, cb_conf);
gtp_set_cb_recovery(gsn, cb_recovery);
gtp_set_cb_data_ind(gsn, cb_data_ind);
gtp_set_cb_unsup_ind(gsn, cb_unsup_ind);
gtp_set_cb_extheader_ind(gsn, cb_extheader_ind);
return 0;
}
开发者ID:jonathanrsantos,项目名称:opensgsn,代码行数:55,代码来源:sgsn_libgtp.c
注:本文中的LOGP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论