|
|
@ -245,6 +245,10 @@ parseFullyEncodedData(IsoPresentation* self, uint8_t* buffer, int len, int bufPo
|
|
|
|
|
|
|
|
|
|
|
|
bufPos += length;
|
|
|
|
bufPos += length;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: fed: unknown tag %02x\n", tag);
|
|
|
|
printf("PRES: fed: unknown tag %02x\n", tag);
|
|
|
@ -289,6 +293,7 @@ parsePCDLEntry(IsoPresentation* self, uint8_t* buffer, int totalLength, int bufP
|
|
|
|
contextId = BerDecoder_decodeUint32(buffer, len, bufPos);
|
|
|
|
contextId = BerDecoder_decodeUint32(buffer, len, bufPos);
|
|
|
|
bufPos += len;
|
|
|
|
bufPos += len;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 0x06: /* abstract-syntax-name */
|
|
|
|
case 0x06: /* abstract-syntax-name */
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: abstract-syntax-name with len %i\n", len);
|
|
|
|
printf("PRES: abstract-syntax-name with len %i\n", len);
|
|
|
@ -305,12 +310,17 @@ parsePCDLEntry(IsoPresentation* self, uint8_t* buffer, int totalLength, int bufP
|
|
|
|
bufPos += len;
|
|
|
|
bufPos += len;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 0x30: /* transfer-syntax-name */
|
|
|
|
case 0x30: /* transfer-syntax-name */
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: ignore transfer-syntax-name\n");
|
|
|
|
printf("PRES: ignore transfer-syntax-name\n");
|
|
|
|
|
|
|
|
|
|
|
|
bufPos += len;
|
|
|
|
bufPos += len;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: unknown tag in presentation-context-definition-list-entry\n");
|
|
|
|
printf("PRES: unknown tag in presentation-context-definition-list-entry\n");
|
|
|
@ -367,6 +377,8 @@ parsePresentationContextDefinitionList(IsoPresentation* self, uint8_t* buffer, i
|
|
|
|
if (bufPos < 0)
|
|
|
|
if (bufPos < 0)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: unknown tag in presentation-context-definition-list\n");
|
|
|
|
printf("PRES: unknown tag in presentation-context-definition-list\n");
|
|
|
@ -436,6 +448,7 @@ parseNormalModeParameters(IsoPresentation* self, uint8_t* buffer, int totalLengt
|
|
|
|
printf("PRES: pcd list\n");
|
|
|
|
printf("PRES: pcd list\n");
|
|
|
|
bufPos = parsePresentationContextDefinitionList(self, buffer, len, bufPos);
|
|
|
|
bufPos = parsePresentationContextDefinitionList(self, buffer, len, bufPos);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 0x61: /* user data */
|
|
|
|
case 0x61: /* user data */
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: user-data\n");
|
|
|
|
printf("PRES: user-data\n");
|
|
|
@ -447,6 +460,9 @@ parseNormalModeParameters(IsoPresentation* self, uint8_t* buffer, int totalLengt
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
printf("PRES: unknown tag in normal-mode\n");
|
|
|
|
printf("PRES: unknown tag in normal-mode\n");
|
|
|
@ -508,6 +524,8 @@ IsoPresentation_parseAcceptMessage(IsoPresentation* self, ByteBuffer* byteBuffer
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
@ -634,6 +652,8 @@ IsoPresentation_parseUserData(IsoPresentation* self, ByteBuffer* readBuffer)
|
|
|
|
|
|
|
|
|
|
|
|
int userDataLength;
|
|
|
|
int userDataLength;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t lengthByte = buffer[bufPos];
|
|
|
|
|
|
|
|
|
|
|
|
bufPos = BerDecoder_decodeLength(buffer, &userDataLength, bufPos, length);
|
|
|
|
bufPos = BerDecoder_decodeLength(buffer, &userDataLength, bufPos, length);
|
|
|
|
|
|
|
|
|
|
|
|
if (bufPos < 0) {
|
|
|
|
if (bufPos < 0) {
|
|
|
@ -642,6 +662,11 @@ IsoPresentation_parseUserData(IsoPresentation* self, ByteBuffer* readBuffer)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lengthByte == 0x80) {
|
|
|
|
|
|
|
|
/* remove end element from user data length when indefinite length encoded */
|
|
|
|
|
|
|
|
userDataLength = userDataLength - 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ByteBuffer_wrap(&(self->nextPayload), buffer + bufPos, userDataLength, userDataLength);
|
|
|
|
ByteBuffer_wrap(&(self->nextPayload), buffer + bufPos, userDataLength, userDataLength);
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -721,6 +746,8 @@ IsoPresentation_parseConnect(IsoPresentation* self, ByteBuffer* byteBuffer)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x00: /* indefinite length end tag -> ignore */
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default: /* unsupported element */
|
|
|
|
default: /* unsupported element */
|
|
|
|
if (DEBUG_PRES)
|
|
|
|
if (DEBUG_PRES)
|
|
|
|