Wiesner András ac5fc9c529 -IP reassembler added
-PcktSieve special return functionality added
-ARP multicast learning bug fixed
-include guards have been refactored
-Doxygen style tweaked
2023-02-04 11:04:26 +01:00

49 lines
1.3 KiB
C

#ifndef ETHERLIB_IGMP_PACKET_H
#define ETHERLIB_IGMP_PACKET_H
#include <stdint.h>
#include "ipv4_types.h"
#include "ethernet_frame.h"
#define ETH_IGMP_PACKET_CLASS (0x0002)
#define ETH_IGMP_HEADER_SIZE (8)
// IGMPv2 is implemented!
typedef enum {
IGMP_MT_MEMBERSHIP_QUERY = 0x11,
IGMP_MT_MEMBERSHIP_REPORT = 0x16,
IGMP_MT_LEAVE_GROUP = 0x17,
} IgmpMsgType;
/**
* IGMP packet properties.
*/
typedef struct {
PcktPropsHeader
uint8_t type; ///< IGMP message type
uint8_t maxRespTime; ///< Maximum response time in 1/10 seconds
uint16_t checksum; ///< Checksum for the entire packet
ip4_addr groupAddr; ///< Group address
} IgmpProps;
/**
* Insert IGMP header.
* @param hdr pointer to message header
* @param headers linked list of recursively encapsulated packet headers
*/
void insert_igmp_header(uint8_t * hdr, const PcktHeaderElement * headers);
/**
* Parse IGMP packet.
* @param hdr pointer to the beginning of the IGMP header
* @param size size of processable buffer area
* @param pcktHdrLe linket list of packet headers
* @param intf Ethernet interface
* @return always 0
*/
int parse_igmp(const uint8_t *hdr, uint32_t size, PcktHeaderElement *pcktHdrLe, struct EthInterface_ *intf, PcktProcFnPassbackData *pb);
#endif //ETHERLIB_IGMP_PACKET_H