本文整理汇总了C++中LOGP函数的典型用法代码示例。如果您正苦于以下问题:C++ LOGP函数的具体用法?C++ LOGP怎么用?C++ LOGP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOGP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}