Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EthernetProtocols.h 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2014.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. *
  28. * General Ethernet protocol constants and type defines, for use by
  29. * all network protocol portions of the TCP/IP stack.
  30. */
  31. #ifndef _ETHERNET_PROTOCOLS_H_
  32. #define _ETHERNET_PROTOCOLS_H_
  33. /* Includes: */
  34. #include <LUFA/Drivers/USB/USB.h>
  35. /* Macros: */
  36. #define ETHERTYPE_IPV4 0x0800
  37. #define ETHERTYPE_ARP 0x0806
  38. #define ETHERTYPE_RARP 0x8035
  39. #define ETHERTYPE_APPLETALK 0x809b
  40. #define ETHERTYPE_APPLETALKARP 0x80f3
  41. #define ETHERTYPE_IEEE8021Q 0x8100
  42. #define ETHERTYPE_NOVELLIPX 0x8137
  43. #define ETHERTYPE_NOVELL 0x8138
  44. #define ETHERTYPE_IPV6 0x86DD
  45. #define ETHERTYPE_COBRANET 0x8819
  46. #define ETHERTYPE_PROVIDERBRIDGING 0x88a8
  47. #define ETHERTYPE_MPLSUNICAST 0x8847
  48. #define ETHERTYPE_MPLSMULTICAST 0x8848
  49. #define ETHERTYPE_PPPoEDISCOVERY 0x8863
  50. #define ETHERTYPE_PPPoESESSION 0x8864
  51. #define ETHERTYPE_EAPOVERLAN 0x888E
  52. #define ETHERTYPE_HYPERSCSI 0x889A
  53. #define ETHERTYPE_ATAOVERETHERNET 0x88A2
  54. #define ETHERTYPE_ETHERCAT 0x88A4
  55. #define ETHERTYPE_SERCOSIII 0x88CD
  56. #define ETHERTYPE_CESoE 0x88D8
  57. #define ETHERTYPE_MACSECURITY 0x88E5
  58. #define ETHERTYPE_FIBRECHANNEL 0x8906
  59. #define ETHERTYPE_QINQ 0x9100
  60. #define ETHERTYPE_VLLT 0xCAFE
  61. #define PROTOCOL_ICMP 1
  62. #define PROTOCOL_IGMP 2
  63. #define PROTOCOL_TCP 6
  64. #define PROTOCOL_UDP 17
  65. #define PROTOCOL_OSPF 89
  66. #define PROTOCOL_SCTP 132
  67. /* Type Defines: */
  68. /** Type define for an Ethernet frame buffer data and information structure. */
  69. typedef struct
  70. {
  71. uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents. */
  72. uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer. */
  73. } Ethernet_Frame_Info_t;
  74. /** Type define for a protocol IP address of a device on a network. */
  75. typedef struct
  76. {
  77. uint8_t Octets[4]; /**< Individual bytes of an IP address */
  78. } IP_Address_t;
  79. #endif