- MMS client/server: removed mms_indication.h and MmsIndication type

pull/143/head
Michael Zillgith 8 years ago
parent f5927cfd68
commit 311cd905f1

@ -30,6 +30,10 @@
#include "byte_buffer.h"
#include "mms_server.h"
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLING 5
#define DEFAULT_MAX_SERV_OUTSTANDING_CALLED 5
#define DEFAULT_DATA_STRUCTURE_NESTING_LEVEL 10
#if (MMS_FILE_SERVICE == 1)
#ifndef CONFIG_MMS_MAX_NUMBER_OF_OPEN_FILES_PER_CONNECTION
@ -73,7 +77,6 @@ FileHandle
mmsMsg_openFile(const char* basepath, char* fileName, bool readWrite);
#endif /* (MMS_FILE_SERVICE == 1) */
typedef struct sMmsServiceError
{
int errorClass;

@ -1,41 +0,0 @@
/*
* 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_ */

@ -31,7 +31,6 @@
#include "libiec61850_platform_includes.h"
#include "mms_common.h"
#include "mms_indication.h"
#include "mms_device_model.h"
#include "mms_value.h"
#include "mms_server.h"
@ -61,10 +60,6 @@ MmsServerConnection_getNamedVariableLists(MmsServerConnection self);
void
MmsServerConnection_deleteNamedVariableList(MmsServerConnection self, char* listName);
MmsIndication
MmsServerConnection_parseMessage(MmsServerConnection connection, ByteBuffer* message, ByteBuffer* response);
/** \brief send information report for a single VMD specific variable
*
* \param handlerMode send this message in the context of a stack callback handler

@ -28,7 +28,6 @@
#include "MmsPdu.h"
#include "mms_common.h"
#include "mms_indication.h"
#include "mms_server_connection.h"
#include "mms_device_model.h"
#include "mms_common_internal.h"

@ -24,7 +24,6 @@
#include "libiec61850_platform_includes.h"
#include "mms_common.h"
#include "mms_common_internal.h"
#include "mms_indication.h"
#include "mms_client_connection.h"
#include "byte_buffer.h"

@ -507,15 +507,13 @@ handleConfirmedResponsePdu(
} /* handleConfirmedResponsePdu */
#endif /* (MMS_OBTAIN_FILE_SERVICE == 1) */
MmsIndication
static inline void
MmsServerConnection_parseMessage(MmsServerConnection self, ByteBuffer* message, ByteBuffer* response)
{
MmsIndication retVal;
uint8_t* buffer = message->buffer;
if (message->size < 2)
return MMS_ERROR;
goto parsing_error;
int bufPos = 0;
@ -525,7 +523,7 @@ MmsServerConnection_parseMessage(MmsServerConnection self, ByteBuffer* message,
bufPos = BerDecoder_decodeLength(buffer, &pduLength, bufPos, message->size);
if (bufPos < 0)
return MMS_ERROR;
goto parsing_error;
if (DEBUG_MMS_SERVER)
printf("MMS_SERVER: recvd MMS-PDU type: %02x size: %i\n", pduType, pduLength);
@ -533,39 +531,43 @@ MmsServerConnection_parseMessage(MmsServerConnection self, ByteBuffer* message,
switch (pduType) {
case 0xa8: /* Initiate request PDU */
mmsServer_handleInitiateRequest(self, buffer, bufPos, bufPos + pduLength, response);
retVal = MMS_INITIATE;
break;
case 0xa0: /* Confirmed request PDU */
handleConfirmedRequestPdu(self, buffer, bufPos, bufPos + pduLength, response);
retVal = MMS_CONFIRMED_REQUEST;
break;
#if (MMS_OBTAIN_FILE_SERVICE == 1)
case 0xa1: /* Confirmed response PDU */
handleConfirmedResponsePdu(self, buffer, bufPos, bufPos + pduLength, response);
retVal = MMS_CONFIRMED_REQUEST;
break;
case 0xa2: /* Confirmed error PDU */
handleConfirmedErrorPdu(self, buffer, 0, bufPos + pduLength, response);
retVal = MMS_CONFIRMED_REQUEST;
break;
#endif /* (MMS_OBTAIN_FILE_SERVICE == 1) */
case 0x8b: /* Conclude request PDU */
mmsServer_writeConcludeResponsePdu(response);
retVal = MMS_CONCLUDE;
break;
case 0xa4: /* Reject PDU - silently ignore */
if (DEBUG_MMS_SERVER)
printf("MMS_SERVER: received reject PDU!\n");
retVal = MMS_OK;
break;
default:
mmsMsg_createMmsRejectPdu(NULL, MMS_ERROR_REJECT_UNKNOWN_PDU_TYPE, response);
retVal = MMS_ERROR;
break;
}
return retVal;
return;
parsing_error:
if (DEBUG_MMS_SERVER)
printf("MMS_SERVER: error parsing message\n");
return;
}
static void /* will be called by IsoConnection */

Loading…
Cancel
Save