Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IPv4 Multicasting

µC/TCP-IP supports IP IPv4 multicasting with IGMP. In order to receive packets addressed to a given IP IPv4 multicast group address, the stack must have been configured to support multicasting in net_cfg.h, and Multicast Configuration, and that host group has to be joined.

Anchor10948921094892The following examples show how to join and leave an IP IPv4 multicast group with µC/TCP-IP:anchor

Code Block

...

language

...

cpp

...

table

NET_IP_ADDR  group_ip_addr;

NET_ERR
err;     if_nbr =
      err;
 
 
if_nbr        = NET_IF_NBR_BASE_CFGD;

group_ip_addr = NetASCII_Str_to_IP(
“233
"233.0.0.
1”
1", &err);
if

if (err != NET_ASCII_ERR_NONE)
{
 {
  /* Handle error. */
}

}
NetIGMP_HostGrpJoin(if_nbr, group_ip_addr, &err);
if

if (err != NET_IGMP_ERR_NONE)
{
 {
  /* Handle error. */
}

}
[...]

NetIGMP_HostGrpLeave(if_nbr, group_ip_addr, &err);
if

if (err != NET_IGMP_ERR_NONE)
{
 {
  /* Handle error. */

}
tr
firstline
Table Cell (td)
rowspan18
Anchor
10973171097317
1summary
classCode_Listing
Table Row (tr)
linenumberstrue
NET_IF_NBR   if_nbr;
Anchor
10973191097319
Anchor
10973211097321
Anchor
11056091105609
Anchor
11056271105627
Anchor
10973251097325
Anchor
10973271097327
Anchor
10973291097329
Anchor
10973311097331
Anchor
10973331097333
Anchor
10973351097335
Anchor
10973371097337
Anchor
10973391097339
Anchor
10973411097341
Anchor
10973431097343
Anchor
10973451097345
Anchor
10973471097347
Anchor
10973491097349
Anchor
10973511097351
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)


Info
Refer to functions NetIGMP_HostGrpJoin and NetIGMP_HostGrpLeave for more details.

IPv6 Multicasting

µC/TCP-IP supports IPv6 multicasting with MLDP. In order to receive packets addressed to a given IPv6 multicast group address, With IPv6 MLDP is always enabled but you might need to increase the number of group, see Multicast Configuration.

The following examples show how to join and leave an IPv6 multicast group with µC/TCP-IP:

Code Block
languagecpp
firstline1
linenumberstrue
NET_IF_NBR     if_nbr;
NET_IPv6_ADDR  group_ip_addr;
NET_ERR        err;
 
 
if_nbr        = NET_IF_NBR_BASE_CFGD;
group_ip_addr = NetASCII_Str_to_IP("FF03::1", &err);
if (err != NET_ASCII_ERR_NONE) {
  /* Handle error. */
}
NetMLDP_HostGrpJoin(if_nbr, group_ip_addr, &err);
if (err != NET_MDLP_ERR_NONE) {
  /* Handle error. */
}
[...]
NetMLDP_HostGrpLeave(if_nbr, group_ip_addr, &err);
if (err != NET_MDLP_ERR_NONE) {
  /* Handle error. */
}


Info
Refer to functions NetMLDP_HostGrpJoin and NetMLDP_HostGrpLeave for more details.