ITS
ForwardingAlgorithmResponse.cpp
Go to the documentation of this file.
2 
4 {
5  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
6  choice.macAddr[i] = 0xFF;
7  choice.integer = 0;
9 }
10 
12 {
13  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
14  choice.macAddr[i] = macAddress.choice.macAddr[i];
15  choice.integer = macAddress.choice.integer;
16  m_present = macAddress.present();
17 }
18 
20 {
21  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
22  choice.macAddr[i] = macAddr[i];
23  choice.integer = 0;
25 }
26 
28 {
29  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
30  choice.macAddr[i] = 0xFF;
33 }
34 
36 {
37  if(present() != macAddress.present())
38  return false;
39  switch (present())
40  {
42  if(choice.integer != macAddress.choice.integer)
43  return false;
44  break;
46  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
47  if(choice.macAddr[i] != macAddress.choice.macAddr[i])
48  return false;
49  break;
51  default:
52  break;
53  }
54  return true;
55 }
56 
58 {
59  return !(*this == macAddress);
60 }
61 
63 {
64  this->m_present = macAddress.present();
65  for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)
66  this->choice.macAddr[i] = macAddress.choice.macAddr[i];
67 
68  return *this;
69 }
int integer() const
integer Integer getter.
ForwardingAlgorithmResponse & operator=(ForwardingAlgorithmResponse macAddress)
operator= ForwardingAlgorithmResponse affectation operator.
ForwardingAlgorithmResponse_PR m_present
Type of the ForwardingAlgorithmResponse.
ForwardingAlgorithmResponseMacAddress_u choice
#define MAC_ADDR_SIZE
Choice between a number or a MAC address.
bool operator==(const ForwardingAlgorithmResponse &macAddress) const
operator== ForwardingAlgorithmResponse comparison operator
ForwardingAlgorithmResponse()
ForwardingAlgorithmResponse ForwardingAlgorithmResponse constructor.
uchar * macAddr()
macAddr MAC address getter.
bool operator!=(const ForwardingAlgorithmResponse &macAddress) const
operator!= ForwardingAlgorithmResponse comparison operator.
ForwardingAlgorithmResponse_PR present() const
present Type of response getter.