NDPHeader.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef NDPHeader_H
  16. #define NDPHeader_H
  17. #include "util/Assert.h"
  18. #include "util/Endian.h"
  19. #include <stdint.h>
  20. struct NDPHeader_NeighborAdvert {
  21. uint8_t oneThirtyFive;
  22. uint8_t zero;
  23. uint16_t checksum;
  24. uint8_t bits;
  25. uint8_t reserved[3];
  26. uint8_t targetAddr[16];
  27. };
  28. #define NDPHeader_NeighborAdvert_SIZE 24
  29. Assert_compileTime(sizeof(struct NDPHeader_NeighborAdvert) == NDPHeader_NeighborAdvert_SIZE);
  30. #define NDPHeader_NeighborAdvert_bits_ROUTER (1<<7)
  31. #define NDPHeader_NeighborAdvert_bits_SOLICITED (1<<6)
  32. #define NDPHeader_NeighborAdvert_bits_OVERRIDE (1<<5)
  33. struct NDPHeader_NeighborAdvert_MacOpt {
  34. uint8_t two; // type
  35. uint8_t one; // length in 8 byte increments
  36. uint8_t mac[6];
  37. };
  38. #endif