aboutsummaryrefslogtreecommitdiffstats
path: root/remsim/RSPRO_EncDec.cc
blob: a1f898e4c3a327c187047832cc4c3557a8cdacb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "RSPRO.hh"

namespace RSPRO__Types {

using namespace RSPRO;

TTCN_Module RSPRO__EncDec("RSPRO_EncDec", __DATE__, __TIME__);

OCTETSTRING enc__RsproPDU(const RsproPDU& pdu) {
	TTCN_Buffer buf;

	buf.clear();
	pdu.encode(RsproPDU_descr_, buf, TTCN_EncDec::CT_BER, BER_ENCODE_DER);
	return OCTETSTRING(buf.get_len(), buf.get_data());
}

RsproPDU dec__RsproPDU(const OCTETSTRING &stream) {
	TTCN_Buffer buf;
	RsproPDU pdu;
	buf.put_os(stream);

	pdu.decode(RsproPDU_descr_, buf, TTCN_EncDec::CT_BER, BER_ACCEPT_ALL);
	return pdu;
}

}