- aded missing header file

pull/6/head
Michael Zillgith 11 years ago
parent d0676ba305
commit 95bc26883e

@ -0,0 +1,41 @@
/*
* mms_indication.h
*
* Copyright 2015 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libIEC61850 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
*
* See COPYING file for the complete license text.
*
*
* MMS client connection handling code for libiec61850.
*
* Handles a MMS client connection.
*/
#ifndef MMS_INDICATION_H_
#define MMS_INDICATION_H_
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLING 5
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLED 5
#define DEFAULT_DATA_STRUCTURE_NESTING_LEVEL 10
typedef enum
{
MMS_ERROR, MMS_INITIATE, MMS_CONFIRMED_REQUEST, MMS_OK, MMS_CONCLUDE
} MmsIndication;
#endif /* MMS_INDICATION_H_ */

@ -20,6 +20,7 @@
* *
* See COPYING file for the complete license text. * See COPYING file for the complete license text.
*/ */
#include <MmsPdu.h> #include <MmsPdu.h>
#include "mms_common.h" #include "mms_common.h"
#include "mms_client_connection.h" #include "mms_client_connection.h"

@ -565,7 +565,7 @@ parseConfirmedErrorPDU(ByteBuffer* message, uint32_t* invokeId, MmsServiceError*
return bufPos; return bufPos;
exit_error: exit_error:
return -1; return -1;
} }

@ -114,47 +114,28 @@ mmsClient_parseInitiateResponse(MmsConnection self)
(void**) &mmsPdu, ByteBuffer_getBuffer(self->lastResponse), (void**) &mmsPdu, ByteBuffer_getBuffer(self->lastResponse),
ByteBuffer_getSize(self->lastResponse)); ByteBuffer_getSize(self->lastResponse));
if (rval.code != RC_OK) goto exit; if (rval.code != RC_OK) goto exit_function;
if (mmsPdu->present == MmsPdu_PR_initiateResponsePdu) { if (mmsPdu->present == MmsPdu_PR_initiateResponsePdu) {
InitiateResponsePdu_t* initiateResponse = &(mmsPdu->choice.initiateResponsePdu); InitiateResponsePdu_t* initiateResponse = &(mmsPdu->choice.initiateResponsePdu);
if (initiateResponse->localDetailCalled != NULL) { if (initiateResponse->localDetailCalled != NULL)
long maxPduSize; self->parameters.maxPduSize = *(initiateResponse->localDetailCalled);
maxPduSize = *(initiateResponse->localDetailCalled); if (initiateResponse->negotiatedDataStructureNestingLevel != NULL)
self->parameters.dataStructureNestingLevel = *(initiateResponse->negotiatedDataStructureNestingLevel);;
self->parameters.maxPduSize = maxPduSize; self->parameters.maxServOutstandingCalled = initiateResponse->negotiatedMaxServOutstandingCalled;
}
if (initiateResponse->negotiatedDataStructureNestingLevel != NULL) { self->parameters.maxServOutstandingCalling = initiateResponse->negotiatedMaxServOutstandingCalling;
long nestingLevel;
nestingLevel = *(initiateResponse->negotiatedDataStructureNestingLevel);
self->parameters.dataStructureNestingLevel = nestingLevel;
}
long maxServerOutstandingCalled;
maxServerOutstandingCalled = initiateResponse->negotiatedMaxServOutstandingCalled;
self->parameters.maxServOutstandingCalled = maxServerOutstandingCalled;
long maxServerOutstandingCalling;
maxServerOutstandingCalling = initiateResponse->negotiatedMaxServOutstandingCalling;
self->parameters.maxServOutstandingCalling = maxServerOutstandingCalling;
result = true; result = true;
} }
else else
//TODO parse error message
result = false; result = false;
exit:
asn_DEF_MmsPdu.free_struct(&asn_DEF_MmsPdu, mmsPdu, 0); asn_DEF_MmsPdu.free_struct(&asn_DEF_MmsPdu, mmsPdu, 0);
exit_function:
return result; return result;
} }

Loading…
Cancel
Save