igmp.c File Reference


Functions

void igmp_init (void)
void igmp_dump_group_list ()
err_t igmp_start (struct netif *netif)
err_t igmp_stop (struct netif *netif)
void igmp_report_groups (struct netif *netif)
struct igmp_group * igmp_lookfor_group (struct netif *ifp, struct ip_addr *addr)
struct igmp_group * igmp_lookup_group (struct netif *ifp, struct ip_addr *addr)
err_t igmp_remove_group (struct igmp_group *group)
void igmp_input (struct pbuf *p, struct netif *inp, struct ip_addr *dest)
err_t igmp_joingroup (struct ip_addr *ifaddr, struct ip_addr *groupaddr)
err_t igmp_leavegroup (struct ip_addr *ifaddr, struct ip_addr *groupaddr)
void igmp_tmr (void)
void igmp_timeout (struct igmp_group *group)
void igmp_start_timer (struct igmp_group *group, u8_t max_time)
void igmp_stop_timer (struct igmp_group *group)
void igmp_delaying_member (struct igmp_group *group, u8_t maxresp)
err_t igmp_ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t proto, struct netif *netif)
void igmp_send (struct igmp_group *group, u8_t type)

Detailed Description

IGMP - Internet Group Management Protocol

Function Documentation

void igmp_delaying_member ( struct igmp_group *  group,
u8_t  maxresp 
)

Delaying membership report for a group if necessary

Parameters:
group the igmp_group for which "delaying" membership report
maxresp query delay

void igmp_dump_group_list (  ) 

Dump global IGMP groups list

void igmp_init ( void   ) 

Initialize the IGMP module

void igmp_input ( struct pbuf *  p,
struct netif inp,
struct ip_addr *  dest 
)

Called from ip_input() if a new IGMP packet is received.

Parameters:
p received igmp packet, p->payload pointing to the ip header
inp network interface on which the packet was received
dest destination ip address of the igmp packet

err_t igmp_ip_output_if ( struct pbuf *  p,
struct ip_addr *  src,
struct ip_addr *  dest,
u8_t  ttl,
u8_t  proto,
struct netif netif 
)

Sends an IP packet on a network interface. This function constructs the IP header and calculates the IP header checksum. If the source IP address is NULL, the IP address of the outgoing network interface is filled in as source address.

Parameters:
p the packet to send (p->payload points to the data, e.g. next protocol header; if dest == IP_HDRINCL, p already includes an IP header and p->payload points to that IP header)
src the source IP address to send from (if src == IP_ADDR_ANY, the IP address of the netif used to send is used as source address)
dest the destination IP address to send the packet to
ttl the TTL value to be set in the IP header
proto the PROTOCOL to be set in the IP header
netif the netif on which to send this packet
Returns:
ERR_OK if the packet was sent OK ERR_BUF if p doesn't have enough space for IP/LINK headers returns errors returned by netif->output

Todo:
should be shared with ip.c - ip_output_if

err_t igmp_joingroup ( struct ip_addr *  ifaddr,
struct ip_addr *  groupaddr 
)

Join a group on one network interface.

Parameters:
ifaddr ip address of the network interface which should join a new group
groupaddr the ip address of the group which to join
Returns:
ERR_OK if group was joined on the netif(s), an err_t otherwise

Todo:
undo any other netif already joined

err_t igmp_leavegroup ( struct ip_addr *  ifaddr,
struct ip_addr *  groupaddr 
)

Leave a group on one network interface.

Parameters:
ifaddr ip address of the network interface which should leave a group
groupaddr the ip address of the group which to leave
Returns:
ERR_OK if group was left on the netif(s), an err_t otherwise

struct igmp_group* igmp_lookfor_group ( struct netif ifp,
struct ip_addr *  addr 
) [read]

Search for a group in the global igmp_group_list

Parameters:
ifp the network interface for which to look
addr the group ip address to search for
Returns:
a struct igmp_group* if the group has been found, NULL if the group wasn't found.

struct igmp_group* igmp_lookup_group ( struct netif ifp,
struct ip_addr *  addr 
) [read]

Search for a specific igmp group and create a new one if not found-

Parameters:
ifp the network interface for which to look
addr the group ip address to search
Returns:
a struct igmp_group*, NULL on memory error.

err_t igmp_remove_group ( struct igmp_group *  group  ) 

Remove a group in the global igmp_group_list

Parameters:
group the group to remove from the global igmp_group_list
Returns:
ERR_OK if group was removed from the list, an err_t otherwise

void igmp_report_groups ( struct netif netif  ) 

Report IGMP memberships for this interface

Parameters:
netif network interface on which report IGMP memberships

void igmp_send ( struct igmp_group *  group,
u8_t  type 
)

Send an igmp packet to a specific group.

Parameters:
group the group to which to send the packet
type the type of igmp packet to send

err_t igmp_start ( struct netif netif  ) 

Start IGMP processing on interface

Parameters:
netif network interface on which start IGMP processing

void igmp_start_timer ( struct igmp_group *  group,
u8_t  max_time 
)

Start a timer for an igmp group

Parameters:
group the igmp_group for which to start a timer
max_time the time in multiples of IGMP_TMR_INTERVAL (decrease with every call to igmp_tmr())

Todo:
Important !! this should be random 0 -> max_time. Find out how to do this

err_t igmp_stop ( struct netif netif  ) 

Stop IGMP processing on interface

Parameters:
netif network interface on which stop IGMP processing

void igmp_stop_timer ( struct igmp_group *  group  ) 

Stop a timer for an igmp_group

Parameters:
group the igmp_group for which to stop the timer

void igmp_timeout ( struct igmp_group *  group  ) 

Called if a timeout for one group is reached. Sends a report for this group.

Parameters:
group an igmp_group for which a timeout is reached

void igmp_tmr ( void   ) 

The igmp timer function (both for NO_SYS=1 and =0) Should be called every IGMP_TMR_INTERVAL milliseconds (100 ms is default).


Generated on Sun Mar 23 19:22:46 2008 for lwIP 1.3.0 by  doxygen 1.5.4