Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
ops.h
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
21 #ifndef HICN_OPS_H
22 #define HICN_OPS_H
23 
24 #include <stdlib.h>
25 
26 #include "error.h"
27 #include "header.h"
28 #include "name.h"
29 
30 /*
31  * hICN operations on packets
32  *
33  * All prototypes take an hicn_type_t parameter as their first argument, as
34  * this decides the sequence of protocols that are being used by the different
35  * operations.
36  */
37 
38 typedef struct hicn_ops_s
39 {
46 
55  ip46_address_t *ip_address);
56 
65  const ip46_address_t *ip_address);
66 
75  hicn_name_t *name);
76 
85  const hicn_name_t *name);
86 
95  hicn_name_suffix_t *suffix);
96 
105  const hicn_name_suffix_t *suffix);
106 
114 
122 
130 
139  ip46_address_t *ip_address);
140 
149  const ip46_address_t *ip_address);
150 
158  int (*get_data_name) (hicn_type_t type, const hicn_protocol_t *h,
159  hicn_name_t *name);
160 
169  const hicn_name_t *name);
170 
179  hicn_name_suffix_t *suffix);
180 
189  const hicn_name_suffix_t *suffix);
190 
199  u32 *pathlabel);
200 
209  const u32 pathlabel);
210 
219  const hicn_faceid_t face_id);
220 
228 
236  int (*get_lifetime) (hicn_type_t type, const hicn_protocol_t *h,
237  hicn_lifetime_t *lifetime);
238 
247  const hicn_lifetime_t lifetime);
248 
260  u16 partial_csum, size_t payload_length);
261 
273  u16 partial_csum, size_t payload_length);
274 
285  const ip46_address_t *addr_new,
286  ip46_address_t *addr_old);
287 
301  const ip46_address_t *addr_new,
302  ip46_address_t *addr_old, const hicn_faceid_t face_id,
303  u8 reset_pl);
304 
312  int (*get_length) (hicn_type_t type, const hicn_protocol_t *h,
313  size_t *length);
314 
323  size_t *header_length);
324 
333  size_t *header_length);
334 
343  size_t *payload_length);
344 
353  size_t payload_length);
354 
363  size_t *signature_size);
364 
373  size_t signature_size);
374 
384  uint8_t signature_gap);
385 
396  uint8_t *signature_gap);
397 
406  uint64_t *signature_timestamp);
407 
416  uint64_t signature_timestamp);
417 
426  uint8_t *validation_algorithm);
427 
436  uint8_t validation_algorithm);
437 
445  int (*get_key_id) (hicn_type_t type, hicn_protocol_t *h, uint8_t **key_id,
446  uint8_t *key_id_size);
447 
455  int (*set_key_id) (hicn_type_t type, hicn_protocol_t *h, uint8_t *key_id);
456 
466  uint8_t **signature);
467 } hicn_ops_t;
468 
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), \
518  }
519 
524 extern const hicn_ops_t *const hicn_ops_vft[];
525 
526 /*
527  * Helpers for writing recursive protocol operations on packet headers
528  *
529  * NOTE : we cannot use a shift operation as IPPROTO_NONE != 0 (and 0 is
530  * IPv4...)
531  */
532 always_inline hicn_type_t
533 TYPE_POP (hicn_type_t type)
534 {
535 #ifndef _WIN32
536  return HICN_TYPE (type.l2, type.l3, type.l4, IPPROTO_NONE);
537 #else
538  hicn_type_t new_type;
539  new_type.l1 = type.l2;
540  new_type.l2 = type.l3;
541  new_type.l3 = type.l4;
542  new_type.l4 = IPPROTO_NONE;
543  return new_type;
544 #endif
545 }
546 
547 always_inline hicn_protocol_t *
548 PAYLOAD (hicn_type_t type, const hicn_protocol_t *h)
549 {
550  size_t header_length;
551  int rc =
552  hicn_ops_vft[type.l1]->get_current_header_length (type, h, &header_length);
553  if (rc < 0)
554  return NULL;
555  return (hicn_protocol_t *) ((u8 *) h + header_length);
556 }
557 
558 #define CHILD_OPS(f, type, h, ...) \
559  (hicn_ops_vft[type.l2]->f (TYPE_POP (type), PAYLOAD (type, h), \
560  ##__VA_ARGS__))
561 
563 #define HICN_OPS4 hicn_ops_vft[IPPROTO_IP]
564 #define HICN_OPS6 hicn_ops_vft[IPPROTO_IPV6]
565 
566 /* Helpers for simple declarations */
567 
568 #define DECLARE_init_packet_header(protocol, error) \
569  int protocol##_init_packet_header (hicn_type_t type, hicn_protocol_t *h) \
570  { \
571  return HICN_LIB_ERROR_##error; \
572  }
573 
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) \
577  { \
578  return HICN_LIB_ERROR_##error; \
579  }
580 
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) \
584  { \
585  return HICN_LIB_ERROR_##error; \
586  }
587 
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) \
591  { \
592  return HICN_LIB_ERROR_##error; \
593  }
594 
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) \
598  { \
599  return HICN_LIB_ERROR_##error; \
600  }
601 
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) \
605  { \
606  return HICN_LIB_ERROR_##error; \
607  }
608 
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) \
612  { \
613  return HICN_LIB_ERROR_##error; \
614  }
615 
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) \
619  { \
620  return HICN_LIB_ERROR_##error; \
621  }
622 
623 #define DECLARE_mark_packet_as_data(protocol, error) \
624  int protocol##_mark_packet_as_data (hicn_type_t type, hicn_protocol_t *h) \
625  { \
626  return HICN_LIB_ERROR_##error; \
627  }
628 
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) \
632  { \
633  return HICN_LIB_ERROR_##error; \
634  }
635 
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) \
639  { \
640  return HICN_LIB_ERROR_##error; \
641  }
642 
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) \
646  { \
647  return HICN_LIB_ERROR_##error; \
648  }
649 
650 #define DECLARE_get_data_name(protocol, error) \
651  int protocol##_get_data_name (hicn_type_t type, const hicn_protocol_t *h, \
652  hicn_name_t *name) \
653  { \
654  return HICN_LIB_ERROR_##error; \
655  }
656 
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) \
660  { \
661  return HICN_LIB_ERROR_##error; \
662  }
663 
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) \
667  { \
668  return HICN_LIB_ERROR_##error; \
669  }
670 
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) \
674  { \
675  return HICN_LIB_ERROR_##error; \
676  }
677 
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) \
681  { \
682  return HICN_LIB_ERROR_##error; \
683  }
684 
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) \
688  { \
689  return HICN_LIB_ERROR_##error; \
690  }
691 
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) \
695  { \
696  return HICN_LIB_ERROR_##error; \
697  }
698 
699 #define DECLARE_reset_data_for_hash(protocol, error) \
700  int protocol##_reset_data_for_hash (hicn_type_t type, hicn_protocol_t *h) \
701  { \
702  return HICN_LIB_ERROR_##error; \
703  }
704 
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) \
708  { \
709  return HICN_LIB_ERROR_##error; \
710  }
711 
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) \
715  { \
716  return HICN_LIB_ERROR_##error; \
717  }
718 
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) \
722  { \
723  return HICN_LIB_ERROR_##error; \
724  }
725 
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) \
729  { \
730  return HICN_LIB_ERROR_##error; \
731  }
732 
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) \
737  { \
738  return HICN_LIB_ERROR_##error; \
739  }
740 
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) \
745  { \
746  return HICN_LIB_ERROR_##error; \
747  }
748 
749 #define DECLARE_get_length(protocol, error) \
750  int protocol##_get_length (hicn_type_t type, const hicn_protocol_t *h, \
751  size_t *length) \
752  { \
753  return HICN_LIB_ERROR_##error; \
754  }
755 
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) \
759  { \
760  return HICN_LIB_ERROR_##error; \
761  }
762 
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) \
766  { \
767  return HICN_LIB_ERROR_##error; \
768  }
769 
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) \
773  { \
774  return HICN_LIB_ERROR_##error; \
775  }
776 
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) \
780  { \
781  return HICN_LIB_ERROR_##error; \
782  }
783 
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) \
787  { \
788  return HICN_LIB_ERROR_##error; \
789  }
790 
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) \
794  { \
795  return HICN_LIB_ERROR_##error; \
796  }
797 
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) \
801  { \
802  return HICN_LIB_ERROR_##error; \
803  }
804 
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) \
808  { \
809  return HICN_LIB_ERROR_##error; \
810  }
811 
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) \
815  { \
816  return HICN_LIB_ERROR_##error; \
817  }
818 
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) \
823  { \
824  return HICN_LIB_ERROR_##error; \
825  }
826 
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) \
830  { \
831  return HICN_LIB_ERROR_##error; \
832  }
833 
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) \
838  { \
839  return HICN_LIB_ERROR_##error; \
840  }
841 
842 #define DECLARE_set_key_id(protocol, error) \
843  int protocol##_set_key_id (hicn_type_t type, hicn_protocol_t *h, \
844  uint8_t *key_id) \
845  { \
846  return HICN_LIB_ERROR_##error; \
847  }
848 
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) \
852  { \
853  return HICN_LIB_ERROR_##error; \
854  }
855 
856 #define DECLARE_get_signature(protocol, error) \
857  int protocol##_get_signature (hicn_type_t type, hicn_protocol_t *h, \
858  uint8_t **signature) \
859  { \
860  return HICN_LIB_ERROR_##error; \
861  }
862 
863 #endif /* HICN_OPS_H */
864 
865 /*
866  * fd.io coding-style-patch-verification: ON
867  *
868  * Local Variables:
869  * eval: (c-set-style "gnu")
870  * End:
871  */
hicn_ops_s::update_checksums
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
hicn_ops_s::get_interest_name_suffix
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
hicn_ops_s::get_signature
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.h
Error management functions.
hicn_ops_s::get_signature_gap
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
hicn_ops_s::get_interest_name
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
hicn_ops_s::get_data_name_suffix
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
hicn_ops_s::set_data_name_suffix
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
hicn_ops_s::mark_packet_as_interest
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
hicn_ops_s::get_current_header_length
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
hicn_ops_s::get_validation_algorithm
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
hicn_ops_s::get_interest_locator
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
hicn_ops_s::get_lifetime
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
hicn_ops_s::get_key_id
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
hicn_ops_s::set_data_name
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
hicn_ops_s::reset_data_for_hash
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
hicn_ops_s::set_interest_name
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_type_t
hICN packet format type
Definition: base.h:56
hicn_ops_s::init_packet_header
int(* init_packet_header)(hicn_type_t type, hicn_protocol_t *h)
Initialize the headers of the hicn packet.
Definition: ops.h:45
hicn_ops_s::reset_interest_for_hash
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
hicn_ops_s::get_header_length
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
hicn_ops_s::get_signature_timestamp
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
hicn_ops_s::set_key_id
int(* set_key_id)(hicn_type_t type, hicn_protocol_t *h, uint8_t *key_id)
Sets the key id.
Definition: ops.h:455
hicn_ops_s::rewrite_interest
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
hicn_ops_s::set_signature_timestamp
int(* set_signature_timestamp)(hicn_type_t type, hicn_protocol_t *h, uint64_t signature_timestamp)
Sets the signature timestamp.
Definition: ops.h:415
hicn_ops_s::set_signature_size
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
hicn_ops_s::set_data_pathlabel
int(* set_data_pathlabel)(hicn_type_t type, hicn_protocol_t *h, const u32 pathlabel)
Sets a Data pathlabel.
Definition: ops.h:208
hicn_ops_s::mark_packet_as_data
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
hicn_type_t::l4
u8 l4
Definition: base.h:65
hicn_ops_s::set_interest_locator
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
hicn_type_t::l1
u8 l1
Definition: base.h:62
hicn_ops_s::set_signature_gap
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
hicn_ops_s::set_interest_name_suffix
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
hicn_ops_s::get_signature_size
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
hicn_ops_s::set_data_locator
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
hicn_type_t::l3
u8 l3
Definition: base.h:64
hicn_protocol_t
Definition: protocol.h:31
hicn_ops_s::update_data_pathlabel
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
hicn_ops_s::get_length
int(* get_length)(hicn_type_t type, const hicn_protocol_t *h, size_t *length)
Return the packet length.
Definition: ops.h:312
hicn_name_t
Definition: name.h:115
hicn_ops_s
Definition: ops.h:38
hicn_ops_s::set_lifetime
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
header.h
hICN header data structures.
hicn_ops_s::rewrite_data
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
hicn_ops_s::get_payload_length
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
hicn_ops_s::get_data_pathlabel
int(* get_data_pathlabel)(hicn_type_t type, const hicn_protocol_t *h, u32 *pathlabel)
Retrieves a Data pathlabel.
Definition: ops.h:198
hicn_ops_s::verify_checksums
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
hicn_type_t::l2
u8 l2
Definition: base.h:63
hicn_ops_s::get_data_locator
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
hicn_ops_s::set_validation_algorithm
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
hicn_ops_s::set_payload_length
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
hicn_ops_s::get_data_name
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
ip46_address_t
Definition: common.h:181