File syn_igmp.h¶
FileList > net > syn_igmp.h
Go to the source code of this file
Zero-Heap Native IGMPv2 Protocol Engine. More...
#include "syntropic/common/syn_defs.h"#include "syntropic/net/syn_eth.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_IGMP |
| struct | SYN_IGMP_Group |
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_igmp_build_report (SYN_IGMP * igmp, SYN_ETH * eth, uint8_t type, uint32_t group_ip, uint8_t * frame_out, size_t * frame_len) Build an IGMPv2 Membership Report (Join Group) or Leave frame over Ethernet. |
| SYN_Status | syn_igmp_init (SYN_IGMP * igmp) Initialize IGMP Engine Context. |
| SYN_Status | syn_igmp_join_group (SYN_IGMP * igmp, SYN_ETH * eth, uint32_t group_ip, uint8_t * frame_out, size_t * frame_len) Join an IPv4 Multicast Group and construct IGMPv2 Join Frame. |
| SYN_Status | syn_igmp_leave_group (SYN_IGMP * igmp, SYN_ETH * eth, uint32_t group_ip, uint8_t * frame_out, size_t * frame_len) Leave an IPv4 Multicast Group and construct IGMPv2 Leave Frame. |
| SYN_Status | syn_igmp_process_packet (SYN_IGMP * igmp, SYN_ETH * eth, const uint8_t * ip_pkt, size_t len, uint8_t * frame_tx, size_t * tx_len) Process incoming IGMP packet (e.g. Membership Query from switch). |
Macros¶
| Type | Name |
|---|---|
| define | SYN_IGMP_MAX_GROUPS 4U |
| define | SYN_IGMP_TYPE_MEMBERSHIP_QUERY 0x11U |
| define | SYN_IGMP_TYPE_V2_LEAVE 0x17U |
| define | SYN_IGMP_TYPE_V2_REPORT 0x16U |
Detailed Description¶
Specifications: * RFC 2236 Internet Group Management Protocol, Version 2 * IP Protocol Number: 2 * Zero dynamic memory allocation (0 bytes heap) * Types: * 0x11: Membership Query * 0x16: IGMPv2 Membership Report (Join) * 0x17: IGMPv2 Leave Group
Public Functions Documentation¶
function syn_igmp_build_report¶
Build an IGMPv2 Membership Report (Join Group) or Leave frame over Ethernet.
SYN_Status syn_igmp_build_report (
SYN_IGMP * igmp,
SYN_ETH * eth,
uint8_t type,
uint32_t group_ip,
uint8_t * frame_out,
size_t * frame_len
)
Parameters:
igmpPointer to IGMP context.ethPointer to Ethernet context.typeSYN_IGMP_TYPE_V2_REPORT or SYN_IGMP_TYPE_V2_LEAVE.group_ip32-bit IPv4 multicast address.frame_outOutput frame buffer (must hold at least 60 bytes).frame_lenPointer to receive final Ethernet II frame length.
Returns:
SYN_OK on success.
function syn_igmp_init¶
Initialize IGMP Engine Context.
Parameters:
igmpPointer to IGMP context.
Returns:
SYN_OK on success.
function syn_igmp_join_group¶
Join an IPv4 Multicast Group and construct IGMPv2 Join Frame.
SYN_Status syn_igmp_join_group (
SYN_IGMP * igmp,
SYN_ETH * eth,
uint32_t group_ip,
uint8_t * frame_out,
size_t * frame_len
)
Parameters:
igmpPointer to IGMP context.ethPointer to Ethernet context.group_ip32-bit IPv4 multicast address (e.g. 224.0.0.251 for mDNS).frame_outOutput frame buffer (must hold at least 60 bytes).frame_lenPointer to receive final Ethernet II frame length.
Returns:
SYN_OK on success.
function syn_igmp_leave_group¶
Leave an IPv4 Multicast Group and construct IGMPv2 Leave Frame.
SYN_Status syn_igmp_leave_group (
SYN_IGMP * igmp,
SYN_ETH * eth,
uint32_t group_ip,
uint8_t * frame_out,
size_t * frame_len
)
Parameters:
igmpPointer to IGMP context.ethPointer to Ethernet context.group_ip32-bit IPv4 multicast address.frame_outOutput frame buffer (must hold at least 60 bytes).frame_lenPointer to receive final Ethernet II frame length.
Returns:
SYN_OK on success.
function syn_igmp_process_packet¶
Process incoming IGMP packet (e.g. Membership Query from switch).
SYN_Status syn_igmp_process_packet (
SYN_IGMP * igmp,
SYN_ETH * eth,
const uint8_t * ip_pkt,
size_t len,
uint8_t * frame_tx,
size_t * tx_len
)
Parameters:
igmpPointer to IGMP context.ethPointer to Ethernet context.ip_pktPointer to incoming IPv4 packet (starting at Ethernet frame).lenLength in bytes.frame_txOutput frame buffer to receive reply report (if generated).tx_lenPointer to receive byte length of generated reply frame.
Returns:
SYN_OK on success.
Macro Definition Documentation¶
define SYN_IGMP_MAX_GROUPS¶
Maximum concurrent multicast groups tracked per engine
define SYN_IGMP_TYPE_MEMBERSHIP_QUERY¶
IGMP Membership Query message type (0x11)
define SYN_IGMP_TYPE_V2_LEAVE¶
IGMPv2 Leave Group message type (0x17)
define SYN_IGMP_TYPE_V2_REPORT¶
IGMPv2 Membership Report message type (0x16)
The documentation for this class was generated from the following file src/syntropic/net/syn_igmp.h