Code Search for Developers
 
 
  

Mdiff.txt from EmStar at Krugle


Show Mdiff.txt syntax highlighted

///////
create status.grad_ref (status device)
create Mdiff_grad_binary()


/////////////////////////////////////////////////////////////////
MDForwarder handles three kinds of packets on the packet device:

1. Filter Priority Update: Filter says what priority it is.

2. Send Message: New message, originating from this node. (Unclear if
   user filters call this.)

3. Recv From Filter

MDForwarder needs to know the priority of filters that connect as
packet device clients so that it can forward messages in order of
priority. As a result, when a filter connects, it needs to send a
packet stating the priority of the filter. In response, MdForwarder
will place that client's profile in the appropriate place in the
packet_device server's client_list structure.

TinyDiffusion also fetches the attributes for each filter and only
forwards the message if it matches. 

Right now, I'm sending the message to the next filter regardless, and
will let the filter decide what to do with it. This allows for more
interesting behavior and simplifies the MdForwarder module.


///////////////////////////////////////////////////////////
// MdOppGradient.c

??? rename functions in .c file, with state pointer
??? declare functions in .h file.
??? references to global vars now go to state vars.

What is AM.h? Active Message?

??? Add timer refs to MdOppGradient State
??? Create periodic timer refs on start-up?
??? Set callbacks
??? Write callbacks 

Need a queue for interest messages.
??? Timer function to periodically rebroadcast interests.

Need a queue for gradients that get periodically timed-out.
??? timer function to periodically time-out gradients.

////
Put TD_PP_LOCAL_BUFF_SIZE in DiffTypes.h

////
We won't need a queue for internal messages. Just call the function.

////
TdFilterI.recv will just pass to matchGradient.

////
What's TdFilterI.getMatchAttr? Skip?

////
Skip publish and unpublish?

////
For subscriptions, MdOppGradient keeps a list of subscribed interests
that it periodically sends out.

//// unsubscribe
take handle. 
Add a new gradient based on the attrs passed.
Create an IntDiffMsg (interest message) and put that in the queue.

////
TdGradientI.getGradientByIndex - just copies the Nth gradient.

For gradients, MdOppGradient keeps a list of gradients in no
particular order. Periodically it times out gradients that are too
old.

////
Timer.fired() Need to look at example timer callback.
done * install gradient and interest timers in MdOppGradient state.
done * start timers in start()
* modify call backs to have correct signature.

Gradients are added as a result of interests or subscriptions.
////
matchGradient()

if it's an interest...

look for gradients that match the interest.
if the matching gradient is due to a local interest, skip.
if the matching gradient was set up by the same node that set the interest
  update the gradient and retransmit the interest
if no matching gradient is found

/// 
MdOppGradient_addGradient





See more files for this project here

EmStar

EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.

Project homepage: http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other

  old/
    MDForwarder.c
    MDForwarder_i.h
    MDOppGradient.c
    MDOppGradient.h
    MD_i.h
    microdiff.c
    microdiff.h
  DiffTypes.h
  MdForwarder.c
  MdForwarder.h
  MdMatch.c
  MdMatch.h
  MdOppGradient.c
  MdOppGradient.h
  Mdiff.h
  Mdiff.txt
  Mdiff_main.c