MACAddress_1.test 943 B

12345678910111213141516171819202122232425262728293031
  1. %description:
  2. Test MACAddress::formInterfaceIdentifier()
  3. %includes:
  4. #include "inet/linklayer/common/MACAddress.h"
  5. #include "inet/networklayer/common/InterfaceToken.h"
  6. #include <iomanip>
  7. static std::ostream& operator<<(std::ostream& os, const ::inet::InterfaceToken& token)
  8. {
  9. return os << "InterfaceToken(" << std::hex << std::setw(8) << std::setfill('0')
  10. << token.normal() << ","
  11. << token.low() << ","
  12. << std::dec << token.length() << ")";
  13. }
  14. %global:
  15. #define P(X) EV << X << "-->" << ::inet::MACAddress(X).formInterfaceIdentifier() << "\n"
  16. %activity:
  17. P("00:00:00:00:00:00");
  18. P("AA:BB:CC:DD:EE:FF");
  19. P("00:21:6b:39:db:48");
  20. EV << ".\n";
  21. %contains: stdout
  22. 00:00:00:00:00:00-->InterfaceToken(020000ff,fe000000,64)
  23. AA:BB:CC:DD:EE:FF-->InterfaceToken(a8bbccff,feddeeff,64)
  24. 00:21:6b:39:db:48-->InterfaceToken(02216bff,fe39db48,64)
  25. .