RINASim  October 2016
Documentation of framework for OMNeT++
DataTransferPDU.cc
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 /*
24  * @file DataTransferPDU.cc
25  * @author Marcel Marek (imarek@fit.vutbr.cz)
26  * @date Oct 19, 2014
27  * @brief
28  * @detail
29  */
30 
31 #include <DataTransferPDU.h>
32 
34 
35 DataTransferPDU::DataTransferPDU(const char *name, int kind): DataTransferPDU_Base(name,kind)
36 {
37  userDataField_var = NULL;
38 
39 }
41  if(other.userDataField_var != NULL){
42 
43 // this->userDataField_var = other.userDataField_var->dup();
44 // take(userDataField_var);
45  }
46 }
47 
48 unsigned int DataTransferPDU::getSize(){
49  //TODO B2 check PDU_HEADER_LEN
51 }
52 
53 
54 
56 {
57  return userDataField_var;
58 }
59 
61 {
62  setByteLength(userDataField_var->getSize() + PDU_HEADER_LEN);
63 }
64 
66 {
67  take(userDataField);
68  this->userDataField_var = userDataField;
70 }
71 
72 //TODO B1 This obviously needs more work.
74 {
76  return -1;
77  }else{
78 
80  }
81 }
82 
83 unsigned int DataTransferPDU::getSDUSeqNum() const
84 {
86 }
int getSDUGap(const DataTransferPDU *other)
unsigned int getSduDelimitFlags() const
void setUserDataField(const UserDataFieldPtr &userDataField)
UserDataFieldPtr userDataField_var
void copy(const DataTransferPDU &other)
#define SDU_SEQ_NUM_PRESENT
Definition: SDU.h:34
unsigned int getSize()
UserDataFieldPtr & getUserDataField()
unsigned int getSDUSeqNum() const
Register_Class(DataTransferPDU)
DataTransferPDU(const char *name=NULL, int kind=0)
unsigned int getSize()
unsigned int getSduSeqNum() const
#define PDU_HEADER_LEN
Definition: PDU_m.h:19