cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

content store redesign (DO NOT MERGE - THIS IS FOR TESTING/EVALUATION) #362

Closed mfrey closed 4 years ago

mfrey commented 5 years ago

Contribution description

This PR is for testing purposes and discussion/evaluation. It introduces a redesigned content store which will allow to support different types of content stores (within respect to data structures, e.g. hash map over linked list, malloc-free content store, etc.).

This PR deprecates the struct ccnl_relay_s member contents. There is some code left in this feature branch where the member is still used, i.e. ccnl-mgmt. However, the question remains if this needs to be modified since the status of the ccnl-mgmt module is not clear (at least to me) - see also discussion on ccnl-mgmt in #158. The member contents is replaced by a member content_options which is a struct holding function pointers to the operations of a content store (implementation). This should be replaced by a function at some point.

@cgundogan and I have had the idea to introduce new (and smaller) data types for name and content but abandoned the idea midway. However, for the sake of the implementation we've introduced typedefs so we could use our new interface. We've had also some unfinished discussions on the ageing functionality used in RIOT. It would be great if we could come up to a conclusion, e.g. implementing an LRU ageing in the data structures. Probably @PeterKietzmann has a few thoughts on it?

This PR is obviously not perfected. There needs to be some refactoring, some squashing, adding a few new features, but it is a start. For now, we have a basic linked list implementation based on utlist, a hash map based implementation (based on uthash) is in my local feature branch (uncommited).

What's next?

I'll try to add some more documentation on the (inner) workings of the new content store. I'll also provide a RIOT feature branch which will allow to test the new content store (done). I'm happy to answer questions and collect bug reports (and fixes)!

Issues/PRs references

This PR is related to #158 and #189

mfrey commented 5 years ago

How to test it on RIOT?

Use the following RIOT feature branch ccnl_cs_integration (it is based on @cgundogan feature branch ccnl-fixes). It assumes that you have the ccn-lite source one directory up of the RIOT directory, e.g. $(RIOTBASE)/../ccn-lite. The example to use (for testing) is examples/ccn-lite-relay

mfrey commented 5 years ago

There is also some (preliminary) documentation on the wiki over here

mfrey commented 4 years ago

Doesn't look like that we progress from here anyway.

cgundogan commented 4 years ago

Doesn't look like that we progress from here anyway.

hmm this decision is somewhat unfortunate.. would it be okay for you if I adopt the PR in near time?