ITS
ForwardingAlgorithmResponse.h
Go to the documentation of this file.
1 
5 #ifndef ForwardingAlgorithmResponse_H
6 #define ForwardingAlgorithmResponse_H
7 
8 #include <QtGlobal>
9 
10 #define MAC_ADDR_SIZE 6
11 
16 {
21 
26 {
28  int integer;
30 
32 {
33 public:
53 
54  /*
55  * Getters
56  */
61  uchar* macAddr() {return choice.macAddr;}
66  int integer() const{return choice.integer;}
72 
73  /*
74  * Setters
75  */
80  void setMacAddr(uchar *m){for(int i = 0 ; i < MAC_ADDR_SIZE ; i++)choice.macAddr[i] = m[i];}
85  void setInteger(int n){choice.integer = n;}
91 
92  /*
93  * Operators
94  */
100  bool operator== (const ForwardingAlgorithmResponse& macAddress) const;
106  bool operator!= (const ForwardingAlgorithmResponse& macAddress) const;
113 
124 private:
127 };
128 
129 #endif // FAWB_MACADDRESS_H
130 
void setPresent(ForwardingAlgorithmResponse_PR p)
setPresent Set the type of response
union ForwardingAlgorithmResponseMacAddress_u ForwardingAlgorithmResponseMacAddress
ForwardingAlgorithmResponseMacAddress union is the union between a number or a MAC address...
int integer() const
integer Integer getter.
ForwardingAlgorithmResponse_PR
ForwardingAlgorithmResponse_PR enum defines the type of address.
ForwardingAlgorithmResponse & operator=(ForwardingAlgorithmResponse macAddress)
operator= ForwardingAlgorithmResponse affectation operator.
ForwardingAlgorithmResponse_PR m_present
Type of the ForwardingAlgorithmResponse.
ForwardingAlgorithmResponseMacAddress_u choice
#define MAC_ADDR_SIZE
ForwardingAlgorithmResponseMacAddress union is the union between a number or a MAC address...
bool operator==(const ForwardingAlgorithmResponse &macAddress) const
operator== ForwardingAlgorithmResponse comparison operator
ForwardingAlgorithmResponse()
ForwardingAlgorithmResponse ForwardingAlgorithmResponse constructor.
void setInteger(int n)
setInteger Integer setter.
bool isMacAddr()
isMacAddr Look if the ForwardingAlgorithmResponse is a MAC address.
uchar * macAddr()
macAddr MAC address getter.
bool isInteger()
isInteger Look if the ForwardingAlgorithmResponse is an integer.
bool operator!=(const ForwardingAlgorithmResponse &macAddress) const
operator!= ForwardingAlgorithmResponse comparison operator.
ForwardingAlgorithmResponse_PR present() const
present Type of response getter.
void setMacAddr(uchar *m)
setMacAddr MAC address setter.