當前位置: 首頁>>代碼示例>>C++>>正文


C++ CHECK_PDU_POINTER_AND_LENGTH_ENCODER函數代碼示例

本文整理匯總了C++中CHECK_PDU_POINTER_AND_LENGTH_ENCODER函數的典型用法代碼示例。如果您正苦於以下問題:C++ CHECK_PDU_POINTER_AND_LENGTH_ENCODER函數的具體用法?C++ CHECK_PDU_POINTER_AND_LENGTH_ENCODER怎麽用?C++ CHECK_PDU_POINTER_AND_LENGTH_ENCODER使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CHECK_PDU_POINTER_AND_LENGTH_ENCODER函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: encode_bearer_resource_allocation_reject

int encode_bearer_resource_allocation_reject(bearer_resource_allocation_reject_msg *bearer_resource_allocation_reject, uint8_t *buffer, uint32_t len)
{
  int encoded = 0;
  int encode_result = 0;

  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, BEARER_RESOURCE_ALLOCATION_REJECT_MINIMUM_LENGTH, len);

  if ((encode_result =
         encode_esm_cause(&bearer_resource_allocation_reject->esmcause, 0,
                          buffer + encoded, len - encoded)) < 0)        //Return in case of error
    return encode_result;
  else
    encoded += encode_result;

  if ((bearer_resource_allocation_reject->presencemask & BEARER_RESOURCE_ALLOCATION_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT)
      == BEARER_RESOURCE_ALLOCATION_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
    if ((encode_result =
           encode_protocol_configuration_options(&bearer_resource_allocation_reject->protocolconfigurationoptions,
               BEARER_RESOURCE_ALLOCATION_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_IEI,
               buffer + encoded, len - encoded)) < 0)
      // Return in case of error
      return encode_result;
    else
      encoded += encode_result;
  }

  return encoded;
}
開發者ID:ShibinMathew36,項目名稱:OAI-step,代碼行數:29,代碼來源:BearerResourceAllocationReject.c

示例2: encode_tracking_area_identity

int encode_tracking_area_identity(TrackingAreaIdentity *trackingareaidentity, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint32_t encoded = 0;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, TRACKING_AREA_IDENTITY_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_tracking_area_identity_xml(trackingareaidentity, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  *(buffer + encoded) = 0x00 | ((trackingareaidentity->mccdigit2 & 0xf) << 4) |
                        (trackingareaidentity->mccdigit1 & 0xf);
  encoded++;
  *(buffer + encoded) = 0x00 | ((trackingareaidentity->mncdigit3 & 0xf) << 4) |
                        (trackingareaidentity->mccdigit3 & 0xf);
  encoded++;
  *(buffer + encoded) = 0x00 | ((trackingareaidentity->mncdigit2 & 0xf) << 4) |
                        (trackingareaidentity->mncdigit1 & 0xf);
  encoded++;
  IES_ENCODE_U16(buffer, encoded, trackingareaidentity->tac);
  return encoded;
}
開發者ID:ShibinMathew36,項目名稱:OAI-step,代碼行數:26,代碼來源:TrackingAreaIdentity.c

示例3: encode_voice_domain_preference_and_ue_usage_setting

int
encode_voice_domain_preference_and_ue_usage_setting (
  VoiceDomainPreferenceAndUeUsageSetting * voicedomainpreferenceandueusagesetting,
  uint8_t iei,
  uint8_t * buffer,
  uint32_t len)
{
  uint8_t                                *lenPtr;
  uint32_t                                encoded = 0;

  /*
   * Checking IEI and pointer
   */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER (buffer, VOICE_DOMAIN_PREFERENCE_AND_UE_USAGE_SETTING_MINIMUM_LENGTH, len);
#if NAS_DEBUG
  dump_voice_domain_preference_and_ue_usage_setting_xml (voicedomainpreferenceandueusagesetting, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr = (buffer + encoded);
  encoded++;
  *(buffer + encoded) = 0x00 | (voicedomainpreferenceandueusagesetting->ue_usage_setting << 2) | voicedomainpreferenceandueusagesetting->voice_domain_for_eutran;
  encoded++;
  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:30,代碼來源:VoiceDomainPreferenceAndUeUsageSetting.c

示例4: encode_time_zone

int
encode_time_zone (
  TimeZone * timezone,
  uint8_t iei,
  uint8_t * buffer,
  uint32_t len)
{
  uint32_t                                encoded = 0;

  /*
   * Checking IEI and pointer
   */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER (buffer, TIME_ZONE_MINIMUM_LENGTH, len);
#if NAS_DEBUG
  dump_time_zone_xml (timezone, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  *(buffer + encoded) = *timezone;
  encoded++;
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:26,代碼來源:TimeZone.c

示例5: encode_nas_message_container

int encode_nas_message_container(NasMessageContainer *nasmessagecontainer, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint8_t *lenPtr;
  uint32_t encoded = 0;
  int encode_result;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, NAS_MESSAGE_CONTAINER_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_nas_message_container_xml(nasmessagecontainer, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr  = (buffer + encoded);
  encoded ++;

  if ((encode_result = encode_octet_string(&nasmessagecontainer->nasmessagecontainercontents, buffer + encoded, len - encoded)) < 0)
    return encode_result;
  else
    encoded += encode_result;

  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:awesome-security,項目名稱:openairinterface5g,代碼行數:27,代碼來源:NasMessageContainer.c

示例6: encode_lcs_client_identity

int encode_lcs_client_identity(LcsClientIdentity *lcsclientidentity, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint8_t *lenPtr;
  uint32_t encoded = 0;
  int encode_result;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, LCS_CLIENT_IDENTITY_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_lcs_client_identity_xml(lcsclientidentity, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr  = (buffer + encoded);
  encoded ++;

  if ((encode_result = encode_octet_string(&lcsclientidentity->lcsclientidentityvalue, buffer + encoded, len - encoded)) < 0)
    return encode_result;
  else
    encoded += encode_result;

  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:ShibinMathew36,項目名稱:OAI-step,代碼行數:27,代碼來源:LcsClientIdentity.c

示例7: encode_authentication_failure_parameter

int encode_authentication_failure_parameter(AuthenticationFailureParameter *authenticationfailureparameter, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint8_t *lenPtr;
  uint32_t encoded = 0;
  int encode_result;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, AUTHENTICATION_FAILURE_PARAMETER_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_authentication_failure_parameter_xml(authenticationfailureparameter, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr  = (buffer + encoded);
  encoded ++;

  if ((encode_result = encode_octet_string(&authenticationfailureparameter->auts, buffer + encoded, len - encoded)) < 0)
    return encode_result;
  else
    encoded += encode_result;

  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:27,代碼來源:AuthenticationFailureParameter.c

示例8: encode_nas_security_algorithms

int
encode_nas_security_algorithms (
  NasSecurityAlgorithms * nassecurityalgorithms,
  uint8_t iei,
  uint8_t * buffer,
  uint32_t len)
{
  uint32_t                                encoded = 0;

  /*
   * Checking IEI and pointer
   */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER (buffer, NAS_SECURITY_ALGORITHMS_MINIMUM_LENGTH, len);
#if NAS_DEBUG
  dump_nas_security_algorithms_xml (nassecurityalgorithms, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  *(buffer + encoded) = 0x00 | ((nassecurityalgorithms->typeofcipheringalgorithm & 0x7) << 4) | (nassecurityalgorithms->typeofintegrityalgorithm & 0x7);
  encoded++;
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:26,代碼來源:NasSecurityAlgorithms.c

示例9: encode_tracking_area_identity_list

int encode_tracking_area_identity_list(TrackingAreaIdentityList *trackingareaidentitylist, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint8_t *lenPtr;
  uint32_t encoded = 0;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, TRACKING_AREA_IDENTITY_LIST_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_tracking_area_identity_list_xml(trackingareaidentitylist, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr  = (buffer + encoded);
  encoded ++;
  *(buffer + encoded) = 0x00 |
                        ((trackingareaidentitylist->typeoflist & 0x3) << 5) |
                        (trackingareaidentitylist->numberofelements & 0x1f);
  encoded++;
  *(buffer + encoded) = 0x00 | ((trackingareaidentitylist->mccdigit2 & 0xf) << 4) |
                        (trackingareaidentitylist->mccdigit1 & 0xf);
  encoded++;
  *(buffer + encoded) = 0x00 | ((trackingareaidentitylist->mncdigit3 & 0xf) << 4) |
                        (trackingareaidentitylist->mccdigit3 & 0xf);
  encoded++;
  *(buffer + encoded) = 0x00 | ((trackingareaidentitylist->mncdigit2 & 0xf) << 4) |
                        (trackingareaidentitylist->mncdigit1 & 0xf);
  encoded++;
  IES_ENCODE_U16(buffer, encoded, trackingareaidentitylist->tac);
  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:34,代碼來源:TrackingAreaIdentityList.c

示例10: encode_location_area_identification

int encode_location_area_identification(LocationAreaIdentification *locationareaidentification, uint8_t iei, uint8_t *buffer, uint32_t len)
{
    uint32_t encoded = 0;
    /* Checking IEI and pointer */
    CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, LOCATION_AREA_IDENTIFICATION_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
    dump_location_area_identification_xml(locationareaidentification, iei);
#endif
    if (iei > 0)
    {
        *buffer = iei;
        encoded++;
    }
    *(buffer + encoded) = 0x00 | ((locationareaidentification->mccdigit2 & 0xf) << 4) |
    (locationareaidentification->mccdigit1 & 0xf);
    encoded++;
    *(buffer + encoded) = 0x00 | ((locationareaidentification->mncdigit3 & 0xf) << 4) |
    (locationareaidentification->mccdigit3 & 0xf);
    encoded++;
    *(buffer + encoded) = 0x00 | ((locationareaidentification->mncdigit2 & 0xf) << 4) |
    (locationareaidentification->mncdigit1 & 0xf);
    encoded++;
    IES_ENCODE_U16(buffer, encoded, locationareaidentification->lac);
    return encoded;
}
開發者ID:mspublic,項目名稱:openair4G-mirror,代碼行數:25,代碼來源:LocationAreaIdentification.c

示例11: encode_authentication_failure

int encode_authentication_failure(authentication_failure_msg *authentication_failure, uint8_t *buffer, uint32_t len)
{
  int encoded = 0;
  int encode_result = 0;

  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, AUTHENTICATION_FAILURE_MINIMUM_LENGTH, len);

  if ((encode_result = encode_emm_cause(&authentication_failure->emmcause, 0,
                                        buffer + encoded, len - encoded)) < 0)        //Return in case of error
    return encode_result;
  else
    encoded += encode_result;

  if ((authentication_failure->presencemask & AUTHENTICATION_FAILURE_AUTHENTICATION_FAILURE_PARAMETER_PRESENT)
      == AUTHENTICATION_FAILURE_AUTHENTICATION_FAILURE_PARAMETER_PRESENT) {
    if ((encode_result =
           encode_authentication_failure_parameter(&authentication_failure->authenticationfailureparameter,
               AUTHENTICATION_FAILURE_AUTHENTICATION_FAILURE_PARAMETER_IEI,
               buffer + encoded, len - encoded)) < 0)
      // Return in case of error
      return encode_result;
    else
      encoded += encode_result;
  }

  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:28,代碼來源:AuthenticationFailure.c

示例12: encode_pdn_address

int encode_pdn_address(PdnAddress *pdnaddress, uint8_t iei, uint8_t *buffer, uint32_t len)
{
  uint8_t *lenPtr;
  uint32_t encoded = 0;
  int encode_result;
  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, PDN_ADDRESS_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
  dump_pdn_address_xml(pdnaddress, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  lenPtr  = (buffer + encoded);
  encoded ++;
  *(buffer + encoded) = 0x00 |
                        (pdnaddress->pdntypevalue & 0x7);
  encoded++;

  if ((encode_result = encode_octet_string(&pdnaddress->pdnaddressinformation, buffer + encoded, len - encoded)) < 0)
    return encode_result;
  else
    encoded += encode_result;

  *lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:30,代碼來源:PdnAddress.c

示例13: encode_short_mac

int
encode_short_mac (
  ShortMac * shortmac,
  uint8_t iei,
  uint8_t * buffer,
  uint32_t len)
{
  uint32_t                                encoded = 0;

  /*
   * Checking IEI and pointer
   */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER (buffer, SHORT_MAC_MINIMUM_LENGTH, len);
#if NAS_DEBUG
  dump_short_mac_xml (shortmac, iei);
#endif

  if (iei > 0) {
    *buffer = iei;
    encoded++;
  }

  IES_ENCODE_U16 (buffer, encoded, *shortmac);
  return encoded;
}
開發者ID:debashish216,項目名稱:lte-testbed-news,代碼行數:25,代碼來源:ShortMac.c

示例14: encode_authentication_request

int encode_authentication_request(authentication_request_msg *authentication_request, uint8_t *buffer, uint32_t len)
{
  int encoded = 0;
  int encode_result = 0;

  /* Checking IEI and pointer */
  CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, AUTHENTICATION_REQUEST_MINIMUM_LENGTH, len);

  *(buffer + encoded) = ((encode_u8_nas_key_set_identifier(&authentication_request->naskeysetidentifierasme) & 0x0f) << 4) | 0x00;
  encoded++;

  if ((encode_result =
         encode_authentication_parameter_rand(&authentication_request->authenticationparameterrand,
             0, buffer + encoded, len - encoded)) < 0)        //Return in case of error
    return encode_result;
  else
    encoded += encode_result;

  if ((encode_result =
         encode_authentication_parameter_autn(&authentication_request->authenticationparameterautn,
             0, buffer + encoded, len - encoded)) < 0)        //Return in case of error
    return encode_result;
  else
    encoded += encode_result;

  return encoded;
}
開發者ID:ShibinMathew36,項目名稱:OAI-step,代碼行數:27,代碼來源:AuthenticationRequest.c

示例15: encode_pdn_disconnect_reject

int encode_pdn_disconnect_reject(pdn_disconnect_reject_msg *pdn_disconnect_reject, uint8_t *buffer, uint32_t len)
{
    int encoded = 0;
    int encode_result = 0;

    /* Checking IEI and pointer */
    CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, PDN_DISCONNECT_REJECT_MINIMUM_LENGTH, len);

    if ((encode_result = encode_esm_cause(&pdn_disconnect_reject->esmcause, 0,
                                          buffer + encoded, len - encoded)) < 0)        //Return in case of error
        return encode_result;
    else
        encoded += encode_result;

    if ((pdn_disconnect_reject->presencemask & PDN_DISCONNECT_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT)
            == PDN_DISCONNECT_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
        if ((encode_result =
                    encode_protocol_configuration_options(&pdn_disconnect_reject->protocolconfigurationoptions,
                            PDN_DISCONNECT_REJECT_PROTOCOL_CONFIGURATION_OPTIONS_IEI, buffer +
                            encoded, len - encoded)) < 0)
            // Return in case of error
            return encode_result;
        else
            encoded += encode_result;
    }

    return encoded;
}
開發者ID:sdnnfv,項目名稱:openair4G,代碼行數:28,代碼來源:PdnDisconnectReject.c


注:本文中的CHECK_PDU_POINTER_AND_LENGTH_ENCODER函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。