mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-07 05:30:14 +00:00
Minor Fix (remove unused USE_ROUTER_ALERT and some coding style)
This commit is contained in:
parent
ac2932bac3
commit
d057e95ce3
@ -220,7 +220,7 @@ void
|
|||||||
igmp_input(struct pbuf *p, struct netif *inp, struct ip_addr *dest)
|
igmp_input(struct pbuf *p, struct netif *inp, struct ip_addr *dest)
|
||||||
{
|
{
|
||||||
struct ip_hdr * iphdr;
|
struct ip_hdr * iphdr;
|
||||||
struct igmpmsg* igmp;
|
struct igmp_msg* igmp;
|
||||||
struct igmp_group* group;
|
struct igmp_group* group;
|
||||||
struct igmp_group* groupref;
|
struct igmp_group* groupref;
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ igmp_input(struct pbuf *p, struct netif *inp, struct ip_addr *dest)
|
|||||||
LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: message to address %l \n", (long)dest->addr));
|
LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: message to address %l \n", (long)dest->addr));
|
||||||
|
|
||||||
/* Now calculate and check the checksum */
|
/* Now calculate and check the checksum */
|
||||||
igmp = (struct igmpmsg *)p->payload;
|
igmp = (struct igmp_msg *)p->payload;
|
||||||
if (inet_chksum(igmp, p->len)) {
|
if (inet_chksum(igmp, p->len)) {
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
IGMP_STATS_INC(igmp.chkerr);
|
IGMP_STATS_INC(igmp.chkerr);
|
||||||
@ -583,18 +583,18 @@ igmp_ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
|||||||
void
|
void
|
||||||
igmp_send(struct igmp_group *group, u8_t type)
|
igmp_send(struct igmp_group *group, u8_t type)
|
||||||
{
|
{
|
||||||
struct pbuf* p = NULL;
|
struct pbuf* p = NULL;
|
||||||
struct igmpmsg* igmp = NULL;
|
struct igmp_msg* igmp = NULL;
|
||||||
struct ip_addr src = {0};
|
struct ip_addr src = {0};
|
||||||
struct ip_addr* dest = NULL;
|
struct ip_addr* dest = NULL;
|
||||||
|
|
||||||
/* IP header + IGMP header */
|
/* IP header + IGMP header */
|
||||||
p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM);
|
p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM);
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
igmp = p->payload;
|
igmp = p->payload;
|
||||||
LWIP_ASSERT("igmp_send: check that first pbuf can hold struct igmpmsg",
|
LWIP_ASSERT("igmp_send: check that first pbuf can hold struct igmp_msg",
|
||||||
(p->len >= sizeof(struct igmpmsg)));
|
(p->len >= sizeof(struct igmp_msg)));
|
||||||
ip_addr_set(&src, &((group->interface)->ip_addr));
|
ip_addr_set(&src, &((group->interface)->ip_addr));
|
||||||
|
|
||||||
if (type == IGMP_V2_MEMB_REPORT) {
|
if (type == IGMP_V2_MEMB_REPORT) {
|
||||||
|
@ -44,11 +44,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some routers are not happy with ROUTER ALERT make it defineable, 1 to enable */
|
|
||||||
#ifndef USE_ROUTER_ALERT
|
|
||||||
#define USE_ROUTER_ALERT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IGMP constants
|
* IGMP constants
|
||||||
*/
|
*/
|
||||||
@ -58,14 +53,14 @@ extern "C" {
|
|||||||
#define ROUTER_ALERTLEN 4
|
#define ROUTER_ALERTLEN 4
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Message types, including version number.
|
* IGMP message types, including version number.
|
||||||
*/
|
*/
|
||||||
#define IGMP_MEMB_QUERY 0x11 /* Membership query */
|
#define IGMP_MEMB_QUERY 0x11 /* Membership query */
|
||||||
#define IGMP_V1_MEMB_REPORT 0x12 /* Ver. 1 membership report */
|
#define IGMP_V1_MEMB_REPORT 0x12 /* Ver. 1 membership report */
|
||||||
#define IGMP_V2_MEMB_REPORT 0x16 /* Ver. 2 membership report */
|
#define IGMP_V2_MEMB_REPORT 0x16 /* Ver. 2 membership report */
|
||||||
#define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */
|
#define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */
|
||||||
|
|
||||||
/* Timer */
|
/* IGMP timer */
|
||||||
#define IGMP_TMR_INTERVAL 100 /* Milliseconds */
|
#define IGMP_TMR_INTERVAL 100 /* Milliseconds */
|
||||||
|
|
||||||
/* MAC Filter Actions */
|
/* MAC Filter Actions */
|
||||||
@ -80,7 +75,7 @@ extern "C" {
|
|||||||
/*
|
/*
|
||||||
* IGMP packet format.
|
* IGMP packet format.
|
||||||
*/
|
*/
|
||||||
struct igmpmsg {
|
struct igmp_msg {
|
||||||
u8_t igmp_msgtype;
|
u8_t igmp_msgtype;
|
||||||
u8_t igmp_maxresp;
|
u8_t igmp_maxresp;
|
||||||
u16_t igmp_checksum;
|
u16_t igmp_checksum;
|
||||||
|
Loading…
Reference in New Issue
Block a user