More IGMP logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2781 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-07-10 17:02:52 +00:00
parent 9086653ed4
commit afae22ae96
8 changed files with 511 additions and 12 deletions
+13 -6
View File
@@ -50,6 +50,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
#include <netinet/in.h>
@@ -89,21 +90,25 @@
#define IGMP_LASTREPORT (1 << 1)
#define IGMP_IDLEMEMBER (1 << 2)
#define IGMP_SCHEDMSG (1 << 3)
#define IGMP_WAITMSG (1 << 4)
#define SET_PREALLOCATED(f) do { (f) |= IGMP_PREALLOCATED; } while (0)
#define SET_LASTREPORT(f) do { (f) |= IGMP_LASTREPORT; } while (0)
#define SET_IDLEMEMBER(f) do { (f) |= IGMP_IDLEMEMBER; } while (0)
#define SET_SCHEDMSG(f) do { (f) |= IGMP_IDLEMEMBER; } while (0)
#define SET_SCHEDMSG(f) do { (f) |= IGMP_SCHEDMSG; } while (0)
#define SET_WAITMSG(f) do { (f) |= IGMP_WAITMSG; } while (0)
#define CLR_PREALLOCATED(f) do { (f) &= ~IGMP_PREALLOCATED; } while (0)
#define CLR_LASTREPORT(f) do { (f) &= ~IGMP_LASTREPORT; } while (0)
#define CLR_IDLEMEMBER(f) do { (f) &= ~IGMP_LASTREPORT; } while (0)
#define CLR_SCHEDMSG(f) do { (f) &= ~IGMP_LASTREPORT; } while (0)
#define CLR_IDLEMEMBER(f) do { (f) &= ~IGMP_IDLEMEMBER; } while (0)
#define CLR_SCHEDMSG(f) do { (f) &= ~IGMP_SCHEDMSG; } while (0)
#define CLR_WAITMSG(f) do { (f) &= ~IGMP_WAITMSG; } while (0)
#define IS_PREALLOCATED(f) (((f) & IGMP_PREALLOCATED) != 0)
#define IS_LASTREPORT(f) (((f) & IGMP_LASTREPORT) != 0)
#define IS_IDLEMEMBER(f) (((f) & IGMP_LASTREPORT) != 0)
#define IS_SCHEDMSG(f) (((f) & IGMP_LASTREPORT) != 0)
#define IS_IDLEMEMBER(f) (((f) & IGMP_IDLEMEMBER) != 0)
#define IS_SCHEDMSG(f) (((f) & IGMP_SCHEDMSG) != 0)
#define IS_WAITMSG(f) (((f) & IGMP_WAITMSG) != 0)
#define IGMP_TTL 1
@@ -175,6 +180,7 @@ struct uip_igmp_stats_s
uint32_t chksum_errors;
uint32_t v1_received;
uint32_t joins;
uint32_t leaves;
uint32_t leave_sched;
uint32_t report_sched;
uint32_t poll_send;
@@ -202,7 +208,8 @@ struct igmp_group_s
struct igmp_group_s *next; /* Implements a singly-linked list */
uip_ipaddr_t grpaddr; /* Group IP address */
WDOG_ID wdog; /* WDOG used to detect timeouts */
uint8_t flags; /* See IGMP_ flags definitions */
sem_t sem; /* Used to wait for message transmission */
volatile uint8_t flags; /* See IGMP_ flags definitions */
uint8_t msgid; /* Pending message ID (if non-zero) */
};