-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduces null checks for functions in ccnl-interest.c/refactoring #307
Conversation
The commit removes dead code from ccnl-interest.c namely a function with the following defintion: struct ccnl_interest_s* ccnl_interest_new(struct ccnl_face_s *from, struct ccnl_pkt_s **pkt) and moves a function with the name, but different parameters from ccnl-relay.c to ccnl-interest.h. The definition is as follows struct ccnl_interest_s* ccnl_interest_new(struct ccnl_relay_s *ccnl, struct ccnl_face_s *from, struct ccnl_pkt_s **pkt);
I'm note sure about moving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
*/ | ||
struct ccnl_pendint_s { | ||
struct ccnl_pendint_s *next; /**< pointer to the next list element */ | ||
struct ccnl_face_s *face; /** */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointer to incoming face
unsigned short flags; /**< ? */ | ||
uint32_t lifetime; /**< interest lifetime */ | ||
uint32_t last_used; /**< last time the entry was used */ | ||
int retries; /**< ? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current number of executed retransmits.
#endif | ||
}; | ||
|
||
|
||
/** | ||
* ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creates a new ccnl_interest_s object
* @param[in] from | ||
* @param[in] pkt | ||
* | ||
* @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal data structure representing an interest object
struct ccnl_face_s *face; | ||
uint32_t last_used; | ||
/** | ||
* ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defines a flag. If set the ccn-lite forwarder should forward/retransmit a packet, otherwise it will be internally.
struct ccnl_pkt_s *pkt; /**< the packet the interests originates from (?) */ | ||
struct ccnl_face_s *from; /**< the face the interest was received from */ | ||
struct ccnl_pendint_s *pending; /**< linked list of faces wanting that content */ | ||
unsigned short flags; /**< ? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags defined for the active interest object. A flag can define, define, if an interest is forwarded or should be handeld internally (forwarded if last bit is set).
Note: This field was previously used to mark an interest as "NFN-Interest" or "R2C-NFN-Interest". Since this is not required anymore, and "internal interests" were also used by NFN we can discuss the usage of this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But don't we still distinguish interests which are forwarded and interests which are actually handled by the forwarder (e.g. creating/delivering content)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so we keep it for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay flags
is only used in ccnl_interest_new
in ccnl-interest.c
and in ccnl_mkInterestObject
in ccnl-pkt-builder.c
. It doesn't seem to be evaluated anywhere. So it is safe to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically just commented out flags
and checked where it would fail to compile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i think it is safe to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll make a seperate PR
Contribution description
The PR introduces
NULL
checks for functionsccnl_interest_isSame
andccnl_interest_remove_pending
, andccnl_interest_append_pending
inccnl-interest.c
and the corresponding unit tests (for now just the failing functions). It also removes dead code from ccnl-interests.c (a function called ccnl_interest_new) and moves a functionccnl_interest_new
fromccnl-relay.c
.Issues/PRs references
None