|
Hybrid ICN (hICN) plugin
v21.06-rc0-4-g18fa668
|
95 hicn_name_suffix_t *suffix);
105 const hicn_name_suffix_t *suffix);
179 hicn_name_suffix_t *suffix);
189 const hicn_name_suffix_t *suffix);
209 const u32 pathlabel);
219 const hicn_faceid_t face_id);
237 hicn_lifetime_t *lifetime);
247 const hicn_lifetime_t lifetime);
260 u16 partial_csum,
size_t payload_length);
273 u16 partial_csum,
size_t payload_length);
323 size_t *header_length);
333 size_t *header_length);
343 size_t *payload_length);
353 size_t payload_length);
363 size_t *signature_size);
373 size_t signature_size);
384 uint8_t signature_gap);
396 uint8_t *signature_gap);
406 uint64_t *signature_timestamp);
416 uint64_t signature_timestamp);
426 uint8_t *validation_algorithm);
436 uint8_t validation_algorithm);
446 uint8_t *key_id_size);
466 uint8_t **signature);
469 #define DECLARE_HICN_OPS(protocol) \
470 const hicn_ops_t hicn_ops_##protocol = { \
471 ATTR_INIT (init_packet_header, protocol##_init_packet_header), \
472 ATTR_INIT (get_interest_locator, protocol##_get_interest_locator), \
473 ATTR_INIT (set_interest_locator, protocol##_set_interest_locator), \
474 ATTR_INIT (get_interest_name, protocol##_get_interest_name), \
475 ATTR_INIT (set_interest_name, protocol##_set_interest_name), \
476 ATTR_INIT (get_interest_name_suffix, \
477 protocol##_get_interest_name_suffix), \
478 ATTR_INIT (set_interest_name_suffix, \
479 protocol##_set_interest_name_suffix), \
480 ATTR_INIT (mark_packet_as_interest, protocol##_mark_packet_as_interest), \
481 ATTR_INIT (mark_packet_as_data, protocol##_mark_packet_as_data), \
482 ATTR_INIT (reset_interest_for_hash, protocol##_reset_interest_for_hash), \
483 ATTR_INIT (get_data_locator, protocol##_get_data_locator), \
484 ATTR_INIT (set_data_locator, protocol##_set_data_locator), \
485 ATTR_INIT (get_data_name, protocol##_get_data_name), \
486 ATTR_INIT (set_data_name, protocol##_set_data_name), \
487 ATTR_INIT (get_data_name_suffix, protocol##_get_data_name_suffix), \
488 ATTR_INIT (set_data_name_suffix, protocol##_set_data_name_suffix), \
489 ATTR_INIT (get_data_pathlabel, protocol##_get_data_pathlabel), \
490 ATTR_INIT (set_data_pathlabel, protocol##_set_data_pathlabel), \
491 ATTR_INIT (update_data_pathlabel, protocol##_update_data_pathlabel), \
492 ATTR_INIT (reset_data_for_hash, protocol##_reset_data_for_hash), \
493 ATTR_INIT (get_lifetime, protocol##_get_lifetime), \
494 ATTR_INIT (set_lifetime, protocol##_set_lifetime), \
495 ATTR_INIT (update_checksums, protocol##_update_checksums), \
496 ATTR_INIT (verify_checksums, protocol##_verify_checksums), \
497 ATTR_INIT (rewrite_interest, protocol##_rewrite_interest), \
498 ATTR_INIT (rewrite_data, protocol##_rewrite_data), \
499 ATTR_INIT (get_length, protocol##_get_length), \
500 ATTR_INIT (get_current_header_length, \
501 protocol##_get_current_header_length), \
502 ATTR_INIT (get_header_length, protocol##_get_header_length), \
503 ATTR_INIT (get_payload_length, protocol##_get_payload_length), \
504 ATTR_INIT (set_payload_length, protocol##_set_payload_length), \
505 ATTR_INIT (get_signature_size, protocol##_get_signature_size), \
506 ATTR_INIT (get_signature_timestamp, protocol##_get_signature_timestamp), \
507 ATTR_INIT (set_signature_timestamp, protocol##_set_signature_timestamp), \
508 ATTR_INIT (get_validation_algorithm, \
509 protocol##_get_validation_algorithm), \
510 ATTR_INIT (set_validation_algorithm, \
511 protocol##_set_validation_algorithm), \
512 ATTR_INIT (get_key_id, protocol##_get_key_id), \
513 ATTR_INIT (set_key_id, protocol##_set_key_id), \
514 ATTR_INIT (get_signature, protocol##_get_signature), \
515 ATTR_INIT (set_signature_gap, protocol##_set_signature_gap), \
516 ATTR_INIT (set_signature_size, protocol##_set_signature_size), \
517 ATTR_INIT (get_signature_gap, protocol##_get_signature_gap), \
524 extern const hicn_ops_t *
const hicn_ops_vft[];
536 return HICN_TYPE (type.
l2, type.
l3, type.
l4, IPPROTO_NONE);
539 new_type.
l1 = type.
l2;
540 new_type.
l2 = type.
l3;
541 new_type.
l3 = type.
l4;
542 new_type.
l4 = IPPROTO_NONE;
550 size_t header_length;
558 #define CHILD_OPS(f, type, h, ...) \
559 (hicn_ops_vft[type.l2]->f (TYPE_POP (type), PAYLOAD (type, h), \
563 #define HICN_OPS4 hicn_ops_vft[IPPROTO_IP]
564 #define HICN_OPS6 hicn_ops_vft[IPPROTO_IPV6]
568 #define DECLARE_init_packet_header(protocol, error) \
569 int protocol##_init_packet_header (hicn_type_t type, hicn_protocol_t *h) \
571 return HICN_LIB_ERROR_##error; \
574 #define DECLARE_get_interest_locator(protocol, error) \
575 int protocol##_get_interest_locator ( \
576 hicn_type_t type, const hicn_protocol_t *h, ip46_address_t *ip_address) \
578 return HICN_LIB_ERROR_##error; \
581 #define DECLARE_set_interest_locator(protocol, error) \
582 int protocol##_set_interest_locator (hicn_type_t type, hicn_protocol_t *h, \
583 const ip46_address_t *ip_address) \
585 return HICN_LIB_ERROR_##error; \
588 #define DECLARE_get_interest_name(protocol, error) \
589 int protocol##_get_interest_name ( \
590 hicn_type_t type, const hicn_protocol_t *h, hicn_name_t *name) \
592 return HICN_LIB_ERROR_##error; \
595 #define DECLARE_set_interest_name(protocol, error) \
596 int protocol##_set_interest_name (hicn_type_t type, hicn_protocol_t *h, \
597 const hicn_name_t *name) \
599 return HICN_LIB_ERROR_##error; \
602 #define DECLARE_get_interest_name_suffix(protocol, error) \
603 int protocol##_get_interest_name_suffix ( \
604 hicn_type_t type, const hicn_protocol_t *h, hicn_name_suffix_t *suffix) \
606 return HICN_LIB_ERROR_##error; \
609 #define DECLARE_set_interest_name_suffix(protocol, error) \
610 int protocol##_set_interest_name_suffix ( \
611 hicn_type_t type, hicn_protocol_t *h, const hicn_name_suffix_t *suffix) \
613 return HICN_LIB_ERROR_##error; \
616 #define DECLARE_mark_packet_as_interest(protocol, error) \
617 int protocol##_mark_packet_as_interest (hicn_type_t type, \
618 hicn_protocol_t *h) \
620 return HICN_LIB_ERROR_##error; \
623 #define DECLARE_mark_packet_as_data(protocol, error) \
624 int protocol##_mark_packet_as_data (hicn_type_t type, hicn_protocol_t *h) \
626 return HICN_LIB_ERROR_##error; \
629 #define DECLARE_reset_interest_for_hash(protocol, error) \
630 int protocol##_reset_interest_for_hash (hicn_type_t type, \
631 hicn_protocol_t *h) \
633 return HICN_LIB_ERROR_##error; \
636 #define DECLARE_get_data_locator(protocol, error) \
637 int protocol##_get_data_locator ( \
638 hicn_type_t type, const hicn_protocol_t *h, ip46_address_t *ip_address) \
640 return HICN_LIB_ERROR_##error; \
643 #define DECLARE_set_data_locator(protocol, error) \
644 int protocol##_set_data_locator (hicn_type_t type, hicn_protocol_t *h, \
645 const ip46_address_t *ip_address) \
647 return HICN_LIB_ERROR_##error; \
650 #define DECLARE_get_data_name(protocol, error) \
651 int protocol##_get_data_name (hicn_type_t type, const hicn_protocol_t *h, \
654 return HICN_LIB_ERROR_##error; \
657 #define DECLARE_set_data_name(protocol, error) \
658 int protocol##_set_data_name (hicn_type_t type, hicn_protocol_t *h, \
659 const hicn_name_t *name) \
661 return HICN_LIB_ERROR_##error; \
664 #define DECLARE_get_data_name_suffix(protocol, error) \
665 int protocol##_get_data_name_suffix ( \
666 hicn_type_t type, const hicn_protocol_t *h, hicn_name_suffix_t *suffix) \
668 return HICN_LIB_ERROR_##error; \
671 #define DECLARE_set_data_name_suffix(protocol, error) \
672 int protocol##_set_data_name_suffix (hicn_type_t type, hicn_protocol_t *h, \
673 const hicn_name_suffix_t *suffix) \
675 return HICN_LIB_ERROR_##error; \
678 #define DECLARE_get_data_pathlabel(protocol, error) \
679 int protocol##_get_data_pathlabel ( \
680 hicn_type_t type, const hicn_protocol_t *h, u32 *pathlabel) \
682 return HICN_LIB_ERROR_##error; \
685 #define DECLARE_set_data_pathlabel(protocol, error) \
686 int protocol##_set_data_pathlabel (hicn_type_t type, hicn_protocol_t *h, \
687 const u32 pathlabel) \
689 return HICN_LIB_ERROR_##error; \
692 #define DECLARE_update_data_pathlabel(protocol, error) \
693 int protocol##_update_data_pathlabel (hicn_type_t type, hicn_protocol_t *h, \
694 const hicn_faceid_t face_id) \
696 return HICN_LIB_ERROR_##error; \
699 #define DECLARE_reset_data_for_hash(protocol, error) \
700 int protocol##_reset_data_for_hash (hicn_type_t type, hicn_protocol_t *h) \
702 return HICN_LIB_ERROR_##error; \
705 #define DECLARE_get_lifetime(protocol, error) \
706 int protocol##_get_lifetime (hicn_type_t type, const hicn_protocol_t *h, \
707 hicn_lifetime_t *lifetime) \
709 return HICN_LIB_ERROR_##error; \
712 #define DECLARE_set_lifetime(protocol, error) \
713 int protocol##_set_lifetime (hicn_type_t type, hicn_protocol_t *h, \
714 const hicn_lifetime_t lifetime) \
716 return HICN_LIB_ERROR_##error; \
719 #define DECLARE_update_checksums(protocol, error) \
720 int protocol##_update_checksums (hicn_type_t type, hicn_protocol_t *h, \
721 u16 partial_csum, size_t payload_length) \
723 return HICN_LIB_ERROR_##error; \
726 #define DECLARE_verify_checksums(protocol, error) \
727 int protocol##_verify_checksums (hicn_type_t type, hicn_protocol_t *h, \
728 u16 partial_csum, size_t payload_length) \
730 return HICN_LIB_ERROR_##error; \
733 #define DECLARE_rewrite_interest(protocol, error) \
734 int protocol##_rewrite_interest (hicn_type_t type, hicn_protocol_t *h, \
735 const ip46_address_t *addr_new, \
736 ip46_address_t *addr_old) \
738 return HICN_LIB_ERROR_##error; \
741 #define DECLARE_rewrite_data(protocol, error) \
742 int protocol##_rewrite_data ( \
743 hicn_type_t type, hicn_protocol_t *h, const ip46_address_t *addr_new, \
744 ip46_address_t *addr_old, const hicn_faceid_t face_id, u8 reset_pl) \
746 return HICN_LIB_ERROR_##error; \
749 #define DECLARE_get_length(protocol, error) \
750 int protocol##_get_length (hicn_type_t type, const hicn_protocol_t *h, \
753 return HICN_LIB_ERROR_##error; \
756 #define DECLARE_get_current_header_length(protocol, error) \
757 int protocol##_get_current_header_length ( \
758 hicn_type_t type, const hicn_protocol_t *h, size_t *header_length) \
760 return HICN_LIB_ERROR_##error; \
763 #define DECLARE_get_header_length(protocol, error) \
764 int protocol##_get_header_length ( \
765 hicn_type_t type, const hicn_protocol_t *h, size_t *header_length) \
767 return HICN_LIB_ERROR_##error; \
770 #define DECLARE_get_payload_length(protocol, error) \
771 int protocol##_get_payload_length ( \
772 hicn_type_t type, const hicn_protocol_t *h, size_t *payload_length) \
774 return HICN_LIB_ERROR_##error; \
777 #define DECLARE_set_payload_length(protocol, error) \
778 int protocol##_set_payload_length (hicn_type_t type, hicn_protocol_t *h, \
779 size_t payload_length) \
781 return HICN_LIB_ERROR_##error; \
784 #define DECLARE_get_signature_size(protocol, error) \
785 int protocol##_get_signature_size ( \
786 hicn_type_t type, const hicn_protocol_t *h, size_t *signature_size) \
788 return HICN_LIB_ERROR_##error; \
791 #define DECLARE_set_signature_size(protocol, error) \
792 int protocol##_set_signature_size (hicn_type_t type, hicn_protocol_t *h, \
793 size_t signature_size) \
795 return HICN_LIB_ERROR_##error; \
798 #define DECLARE_set_signature_gap(protocol, error) \
799 int protocol##_set_signature_gap (hicn_type_t type, hicn_protocol_t *h, \
800 uint8_t signature_size) \
802 return HICN_LIB_ERROR_##error; \
805 #define DECLARE_get_signature_gap(protocol, error) \
806 int protocol##_get_signature_gap ( \
807 hicn_type_t type, const hicn_protocol_t *h, uint8_t *signature_size) \
809 return HICN_LIB_ERROR_##error; \
812 #define DECLARE_set_signature_timestamp(protocol, error) \
813 int protocol##_set_signature_timestamp ( \
814 hicn_type_t type, hicn_protocol_t *h, uint64_t signature_timestamp) \
816 return HICN_LIB_ERROR_##error; \
819 #define DECLARE_get_signature_timestamp(protocol, error) \
820 int protocol##_get_signature_timestamp (hicn_type_t type, \
821 const hicn_protocol_t *h, \
822 uint64_t *signature_timestamp) \
824 return HICN_LIB_ERROR_##error; \
827 #define DECLARE_set_validation_algorithm(protocol, error) \
828 int protocol##_set_validation_algorithm ( \
829 hicn_type_t type, hicn_protocol_t *h, uint8_t validation_algorithm) \
831 return HICN_LIB_ERROR_##error; \
834 #define DECLARE_get_validation_algorithm(protocol, error) \
835 int protocol##_get_validation_algorithm (hicn_type_t type, \
836 const hicn_protocol_t *h, \
837 uint8_t *validation_algorithm) \
839 return HICN_LIB_ERROR_##error; \
842 #define DECLARE_set_key_id(protocol, error) \
843 int protocol##_set_key_id (hicn_type_t type, hicn_protocol_t *h, \
846 return HICN_LIB_ERROR_##error; \
849 #define DECLARE_get_key_id(protocol, error) \
850 int protocol##_get_key_id (hicn_type_t type, hicn_protocol_t *h, \
851 uint8_t **key_id, uint8_t *key_id_size) \
853 return HICN_LIB_ERROR_##error; \
856 #define DECLARE_get_signature(protocol, error) \
857 int protocol##_get_signature (hicn_type_t type, hicn_protocol_t *h, \
858 uint8_t **signature) \
860 return HICN_LIB_ERROR_##error; \
int(* update_checksums)(hicn_type_t type, hicn_protocol_t *h, u16 partial_csum, size_t payload_length)
Update all checksums in packet headers.
Definition: ops.h:259
int(* get_interest_name_suffix)(hicn_type_t type, const hicn_protocol_t *h, hicn_name_suffix_t *suffix)
Retrieves an Interest name suffix.
Definition: ops.h:94
int(* get_signature)(hicn_type_t type, hicn_protocol_t *h, uint8_t **signature)
Get a pointer to the signature field in the packet.
Definition: ops.h:465
Error management functions.
int(* get_signature_gap)(hicn_type_t type, const hicn_protocol_t *h, uint8_t *signature_gap)
gets an Interest or Data signature gap between maximum size and real size
Definition: ops.h:395
int(* get_interest_name)(hicn_type_t type, const hicn_protocol_t *h, hicn_name_t *name)
Retrieves an Interest name.
Definition: ops.h:74
int(* get_data_name_suffix)(hicn_type_t type, const hicn_protocol_t *h, hicn_name_suffix_t *suffix)
Retrieves a Data name suffix.
Definition: ops.h:178
int(* set_data_name_suffix)(hicn_type_t type, hicn_protocol_t *h, const hicn_name_suffix_t *suffix)
Sets a Data name suffix.
Definition: ops.h:188
int(* mark_packet_as_interest)(hicn_type_t type, hicn_protocol_t *h)
Set flag to mark current packet as interest.
Definition: ops.h:113
int(* get_current_header_length)(hicn_type_t type, const hicn_protocol_t *h, size_t *header_length)
Return the current packet header length.
Definition: ops.h:322
int(* get_validation_algorithm)(hicn_type_t type, const hicn_protocol_t *h, uint8_t *validation_algorithm)
Gets the signature validation algorithm.
Definition: ops.h:425
int(* get_interest_locator)(hicn_type_t type, const hicn_protocol_t *h, ip46_address_t *ip_address)
Retrieves an Interest locator.
Definition: ops.h:54
int(* get_lifetime)(hicn_type_t type, const hicn_protocol_t *h, hicn_lifetime_t *lifetime)
Retrieves an Interest or Data lifetime.
Definition: ops.h:236
int(* get_key_id)(hicn_type_t type, hicn_protocol_t *h, uint8_t **key_id, uint8_t *key_id_size)
Gets the key id.
Definition: ops.h:445
int(* set_data_name)(hicn_type_t type, hicn_protocol_t *h, const hicn_name_t *name)
Sets a Data name.
Definition: ops.h:168
int(* reset_data_for_hash)(hicn_type_t type, hicn_protocol_t *h)
Clear the necessary Data fields in order to hash it.
Definition: ops.h:227
int(* set_interest_name)(hicn_type_t type, hicn_protocol_t *h, const hicn_name_t *name)
Sets an Interest name.
Definition: ops.h:84
hICN packet format type
Definition: base.h:56
int(* init_packet_header)(hicn_type_t type, hicn_protocol_t *h)
Initialize the headers of the hicn packet.
Definition: ops.h:45
int(* reset_interest_for_hash)(hicn_type_t type, hicn_protocol_t *h)
Clear the necessary Interest fields in order to hash it.
Definition: ops.h:129
int(* get_header_length)(hicn_type_t type, const hicn_protocol_t *h, size_t *header_length)
Return the packet header length.
Definition: ops.h:332
int(* get_signature_timestamp)(hicn_type_t type, const hicn_protocol_t *h, uint64_t *signature_timestamp)
Gets the signature timestamp.
Definition: ops.h:405
int(* set_key_id)(hicn_type_t type, hicn_protocol_t *h, uint8_t *key_id)
Sets the key id.
Definition: ops.h:455
int(* rewrite_interest)(hicn_type_t type, hicn_protocol_t *h, const ip46_address_t *addr_new, ip46_address_t *addr_old)
Rewrite an Interest packet header (locator)
Definition: ops.h:284
int(* set_signature_timestamp)(hicn_type_t type, hicn_protocol_t *h, uint64_t signature_timestamp)
Sets the signature timestamp.
Definition: ops.h:415
int(* set_signature_size)(hicn_type_t type, hicn_protocol_t *h, size_t signature_size)
Sets an Interest or Data signature size.
Definition: ops.h:372
int(* set_data_pathlabel)(hicn_type_t type, hicn_protocol_t *h, const u32 pathlabel)
Sets a Data pathlabel.
Definition: ops.h:208
int(* mark_packet_as_data)(hicn_type_t type, hicn_protocol_t *h)
Set flag to mark current packet as data.
Definition: ops.h:121
u8 l4
Definition: base.h:65
int(* set_interest_locator)(hicn_type_t type, hicn_protocol_t *h, const ip46_address_t *ip_address)
Sets an Interest locator.
Definition: ops.h:64
u8 l1
Definition: base.h:62
int(* set_signature_gap)(hicn_type_t type, hicn_protocol_t *h, uint8_t signature_gap)
Sets an Interest or Data signature gap between maximum size and real size.
Definition: ops.h:383
int(* set_interest_name_suffix)(hicn_type_t type, hicn_protocol_t *h, const hicn_name_suffix_t *suffix)
Sets an Interest name suffix.
Definition: ops.h:104
int(* get_signature_size)(hicn_type_t type, const hicn_protocol_t *h, size_t *signature_size)
Retrieves an Interest or Data signature size.
Definition: ops.h:362
int(* set_data_locator)(hicn_type_t type, hicn_protocol_t *h, const ip46_address_t *ip_address)
Sets a Data locator.
Definition: ops.h:148
u8 l3
Definition: base.h:64
Definition: protocol.h:31
int(* update_data_pathlabel)(hicn_type_t type, hicn_protocol_t *h, const hicn_faceid_t face_id)
Update a Data pathlabel with a new face identifier.
Definition: ops.h:218
int(* get_length)(hicn_type_t type, const hicn_protocol_t *h, size_t *length)
Return the packet length.
Definition: ops.h:312
int(* set_lifetime)(hicn_type_t type, hicn_protocol_t *h, const hicn_lifetime_t lifetime)
Sets an Interest or Data lifetime.
Definition: ops.h:246
int(* rewrite_data)(hicn_type_t type, hicn_protocol_t *h, const ip46_address_t *addr_new, ip46_address_t *addr_old, const hicn_faceid_t face_id, u8 reset_pl)
Rewrite a Data packet header (locator + pathlabel)
Definition: ops.h:300
int(* get_payload_length)(hicn_type_t type, const hicn_protocol_t *h, size_t *payload_length)
Return the packet payload length.
Definition: ops.h:342
int(* get_data_pathlabel)(hicn_type_t type, const hicn_protocol_t *h, u32 *pathlabel)
Retrieves a Data pathlabel.
Definition: ops.h:198
int(* verify_checksums)(hicn_type_t type, hicn_protocol_t *h, u16 partial_csum, size_t payload_length)
Validate all checksums in packet headers.
Definition: ops.h:272
u8 l2
Definition: base.h:63
int(* get_data_locator)(hicn_type_t type, const hicn_protocol_t *h, ip46_address_t *ip_address)
Retrieves a Data locator.
Definition: ops.h:138
int(* set_validation_algorithm)(hicn_type_t type, hicn_protocol_t *h, uint8_t validation_algorithm)
Sets the signature validation algorithm.
Definition: ops.h:435
int(* set_payload_length)(hicn_type_t type, hicn_protocol_t *h, size_t payload_length)
Sets the packet paylaod length.
Definition: ops.h:352
int(* get_data_name)(hicn_type_t type, const hicn_protocol_t *h, hicn_name_t *name)
Retrieves a Data name.
Definition: ops.h:158