这篇教程C++ xer_fprint函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xer_fprint函数的典型用法代码示例。如果您正苦于以下问题:C++ xer_fprint函数的具体用法?C++ xer_fprint怎么用?C++ xer_fprint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xer_fprint函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: verifystatic voidverify(int testNo, T_t *ti) { asn_enc_rval_t er; asn_dec_rval_t rv; unsigned char buf[20]; T_t *to = 0; fprintf(stderr, "%d IN: { %lu, %lu, %ld, %ld }/n", testNo, i2ul(&ti->unsigned33), i2ul(&ti->unsigned42), i2l(&ti->signed33), i2l(&ti->signed33ext) ); er = uper_encode_to_buffer(&asn_DEF_T, ti, buf, sizeof buf); assert(er.encoded >= 33 + 42 + 33 + 1 + 33); rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0); assert(rv.code == RC_OK); fprintf(stderr, "%d ENC: %2x%2x%2x%2x %2x%2x%2x%2x/n", testNo, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); fprintf(stderr, "%d OUT: { %lu, %lu, %ld, %ld } vs { %lu, %lu, %ld, %ld }/n", testNo, i2ul(&ti->unsigned33), i2ul(&ti->unsigned42), i2l(&ti->signed33), i2l(&ti->signed33ext), i2ul(&to->unsigned33), i2ul(&to->unsigned42), i2l(&to->signed33), i2l(&to->signed33ext)); assert(i2ul(&ti->unsigned33) == i2ul(&to->unsigned33)); assert(i2ul(&ti->unsigned42) == i2ul(&to->unsigned42)); assert(i2l(&ti->signed33) == i2l(&to->signed33)); assert(i2l(&ti->signed33ext) == i2l(&to->signed33ext)); xer_fprint(stderr, &asn_DEF_T, ti); xer_fprint(stderr, &asn_DEF_T, to);}
开发者ID:Arcen,项目名称:asn1c,代码行数:35,
示例2: verifystatic voidverify(int testNo, T_t *ti) { asn_enc_rval_t er; asn_dec_rval_t rv; unsigned char buf[2]; T_t *to = 0; er = uper_encode_to_buffer(&asn_DEF_T, ti, buf, sizeof buf); fprintf(stderr, "%d IN: %d => %zd/n", testNo, ti->present, er.encoded); assert(er.encoded >= 1 && er.encoded <= (ssize_t)(8 * sizeof(buf))); rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0); assert(rv.code == RC_OK); fprintf(stderr, "%d ENC: %2x%2x/n", testNo, buf[0], buf[1]); fprintf(stderr, "%d OUT: %d/n", testNo, ti->present); assert(ti->present == to->present); if(ti->present == T_PR_second) { assert(ti->choice.second == to->choice.second); } else { assert(ti->choice.first.present == to->choice.first.present); assert(ti->choice.first.choice.nothing == to->choice.first.choice.nothing); } xer_fprint(stderr, &asn_DEF_T, ti); xer_fprint(stderr, &asn_DEF_T, to);}
开发者ID:carriercomm,项目名称:asn1c,代码行数:28,
示例3: verifystatic voidverify(int testNo, T_t *ti) { asn_enc_rval_t er; asn_dec_rval_t rv; unsigned char buf[16]; T_t *to = 0; fprintf(stderr, "%d IN: { %ld, %ld, %lu, %lu }/n", testNo, ti->small32range, ti->full32range, ti->unsigned32, ti->unsplit32); er = uper_encode_to_buffer(&asn_DEF_T, ti, buf, sizeof buf); assert(er.encoded == 8 * sizeof(buf)); rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0); assert(rv.code == RC_OK); fprintf(stderr, "%d ENC: %2x%2x%2x%2x %2x%2x%2x%2x/n", testNo, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); fprintf(stderr, "%d OUT: { %ld, %ld, %lu, %lu } vs { %ld, %ld, %lu, %lu }/n", testNo, ti->small32range, ti->full32range, ti->unsigned32, ti->unsplit32, to->small32range, to->full32range, to->unsigned32, to->unsplit32); assert(ti->small32range == to->small32range); assert(ti->full32range == to->full32range); assert(ti->unsigned32 == to->unsigned32); assert(ti->unsplit32 == to->unsplit32); xer_fprint(stderr, &asn_DEF_T, ti); xer_fprint(stderr, &asn_DEF_T, to);}
开发者ID:Arcen,项目名称:asn1c,代码行数:34,
示例4: rua_decode_errorindicationiesint rua_decode_errorindicationies( ErrorIndicationIEs_t *errorIndicationIEs, ANY_t *any_p) { ErrorIndication_t errorIndication; ErrorIndication_t *errorIndication_p = &errorIndication; int i, decoded = 0; int tempDecoded = 0; assert(any_p != NULL); assert(errorIndicationIEs != NULL); RUA_DEBUG("Decoding message ErrorIndicationIEs (%s:%d)/n", __FILE__, __LINE__); ANY_to_type_aper(any_p, &asn_DEF_ErrorIndication, (void**)&errorIndication_p); for (i = 0; i < errorIndication_p->errorIndication_ies.list.count; i++) { IE_t *ie_p; ie_p = errorIndication_p->errorIndication_ies.list.array[i]; switch(ie_p->id) { case ProtocolIE_ID_id_Cause: { Cause_t cause; Cause_t *cause_p = &cause; tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Cause, (void**)&cause_p); if (tempDecoded < 0) { RUA_DEBUG("Decoding of IE cause failed/n"); return -1; } decoded += tempDecoded; if (asn1_xer_print) xer_fprint(stdout, &asn_DEF_Cause, cause_p); memcpy(&errorIndicationIEs->cause, cause_p, sizeof(Cause_t)); } break; /* Optional field */ case ProtocolIE_ID_id_CriticalityDiagnostics: { CriticalityDiagnostics_t criticalityDiagnostics; CriticalityDiagnostics_t *criticalityDiagnostics_p = &criticalityDiagnostics; errorIndicationIEs->presenceMask |= ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT; tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_CriticalityDiagnostics, (void**)&criticalityDiagnostics_p); if (tempDecoded < 0) { RUA_DEBUG("Decoding of IE criticalityDiagnostics failed/n"); return -1; } decoded += tempDecoded; if (asn1_xer_print) xer_fprint(stdout, &asn_DEF_CriticalityDiagnostics, criticalityDiagnostics_p); memcpy(&errorIndicationIEs->criticalityDiagnostics, criticalityDiagnostics_p, sizeof(CriticalityDiagnostics_t)); } break; default: RUA_DEBUG("Unknown protocol IE id (%d) for message errorindicationies/n", (int)ie_p->id); return -1; } } return decoded;}
开发者ID:osmocom,项目名称:osmo-iuh,代码行数:56,
示例5: mainint main() { LDAPMessage_t *req_bind, *req_search, *req_unbind; LDAPMessage_t *rsp_bind, *rsp_search1, *rsp_search2, *rsp_search_done; int sock = accept_single_connection(3389); fprintf(stderr, "Receiving LDAP message.../n"); req_bind = receive_ldap_message(sock); assert(req_bind); assert(req_bind->protocolOp.present == LDAPMessage__protocolOp_PR_bindRequest); assert(req_bind->protocolOp.choice.bindRequest.version == 3); fprintf(stderr, "Received BindRequest.../n"); asn_fprint(stderr, &asn_DEF_LDAPMessage, req_bind); fprintf(stderr, "Sending BindReply.../n"); rsp_bind = bind_response_ok(req_bind->messageID, &req_bind->protocolOp.choice.bindRequest.name); asn_fprint(stderr, &asn_DEF_LDAPMessage, rsp_bind); send_ldap_message(sock, rsp_bind); req_search = receive_ldap_message(sock); assert(req_search->protocolOp.present == LDAPMessage__protocolOp_PR_searchRequest); fprintf(stderr, "Received SearchRequest.../n"); xer_fprint(stderr, &asn_DEF_LDAPMessage, req_search); rsp_search1 = search_result_entry(req_search->messageID, "Lev Walkin", "[email C++ xerror函数代码示例 C++ xenbus_transaction_start函数代码示例
|