named-data-iot / ndn-lite

A lightweight NDN protocol stack with high-level application support including security bootstrapping, access control, trust management, etc.
https://ndn-lite.named-data.net
GNU Lesser General Public License v3.0
44 stars 16 forks source link

skeleton full consumer #63

Closed dulalsaurab closed 4 years ago

dulalsaurab commented 5 years ago

Sorry this was pushed by mistake, it's wip. We will have better version in future.

Saurab,

On Sun, Sep 8, 2019, 7:13 AM Junxiao Shi notifications@github.com wrote:

@yoursunny requested changes on this pull request.

Obviously it's WIP. Please tag as such.

In psync-fconsumer/full-consumer.h https://github.com/named-data-iot/ndn-lite/pull/63#discussion_r322003847 :

+#ifndef FULL_CONSUMER_H +#define FULL_CONSUMER_H + + +typedef struct +{

  • // Store sequence number for the prefix.
  • ndn_name_t prefix;
  • uint64_t sequence_number; +} prefixes;
  • +typedef struct +{ +// define all the required variables i.e. face, io-service and all

  • ndn_unix_face_t* unix_face;

PSync protocol shouldn't depend on particular face type. It only needs a pointer to the base type.

In psync-fconsumer/full-consumer.h https://github.com/named-data-iot/ndn-lite/pull/63#discussion_r322003878 :

  • ndn_name_t m_syncInterestPrefix;
  • ndn_name_t m_iblt;
  • ndn_name_t m_syncDataName;
  • uint32_t jitter;
  • // srand(time(NULL)); //we can use this to create a random number
  • +} full_consumer;

  • +// const ndn::Name& syncPrefix, +// ndn::Face& face, +// const UpdateCallback& onUpdate, +// ndn::time::milliseconds syncInterestLifetime

  • +void init_full_consumer (char syncPrefix, ndn_udp_face_t face,

const char*

In psync-fconsumer/full-consumer.h https://github.com/named-data-iot/ndn-lite/pull/63#discussion_r322003912 :

  • uint32_t jitter;
  • // srand(time(NULL)); //we can use this to create a random number
  • +} full_consumer;

  • +// const ndn::Name& syncPrefix, +// ndn::Face& face, +// const UpdateCallback& onUpdate, +// ndn::time::milliseconds syncInterestLifetime

  • +void init_full_consumer (char syncPrefix, ndn_udp_face_t face,

  • void (onUpdate)(void));
  • +void send_sync_interet();

Every function name should start with ndn_psync_full_consumer

In psync-fconsumer/full-consumer.h https://github.com/named-data-iot/ndn-lite/pull/63#discussion_r322003957 :

@@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include +#include "ndn-lite/encode/name.h" +#include "ndn-lite/encode/data.h" +#include "ndn-lite/encode/interest.h" +#include +#include + + +#ifndef FULL_CONSUMER_H

Include guard goes before #include lines

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/named-data-iot/ndn-lite/pull/63?email_source=notifications&email_token=ABDQNYTAGCA6SVFBS4GMCNDQITM6RA5CNFSM4IURD2LKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCD77IBI#pullrequestreview-285209605, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDQNYWC4XAWBKBW5AP56NTQITM6RANCNFSM4IURD2LA .

dulalsaurab commented 4 years ago

WIP, not ready for PR.