aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-10-29 23:46:44 +0000
committerBart Polot <bart@net.in.tum.de>2016-10-29 23:46:44 +0000
commitf7f26f6ca1b76d2734463d4989b9541df48a6773 (patch)
treeefcbc1e51bbe162577b981dd3e601aec81a348a8 /src/include
parenta3735db333033ccefc95c56148ec3118bf7a0ccd (diff)
downloadgnunet-f7f26f6ca1b76d2734463d4989b9541df48a6773.tar.gz
gnunet-f7f26f6ca1b76d2734463d4989b9541df48a6773.zip
Refactor encrypted traffic handling
- eliminate encapsulation for KX/DATA - simplify cases - remove dead code - Organize message types
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_constants.h2
-rw-r--r--src/include/gnunet_protocols.h114
2 files changed, 62 insertions, 54 deletions
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index a40354fb5..ef9b27318 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -127,7 +127,7 @@ extern "C"
127 127
128/** 128/**
129 * Size of the CADET message overhead: 129 * Size of the CADET message overhead:
130 * + sizeof (struct GNUNET_CADET_AX) 130 * = sizeof (struct GNUNET_CADET_Encrypted)
131 * + sizeof (struct GNUNET_CADET_Data) 131 * + sizeof (struct GNUNET_CADET_Data)
132 * + sizeof (struct GNUNET_CADET_ACK)) 132 * + sizeof (struct GNUNET_CADET_ACK))
133 * 133 *
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index ea94645c5..9cb553282 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2610,77 +2610,82 @@ extern "C"
2610/*******************************************************************************/ 2610/*******************************************************************************/
2611 2611
2612 2612
2613/******************************************************************************* 2613/******************************************************************************/
2614 * CADET message types 2614/*********************************** CADET **********************************/
2615 ******************************************************************************/ 2615/******************************************************************************/
2616 2616/* CADET: message types 1000-1059
2617/** 2617 * 1000-1009 Connection-level Messages
2618 * Type of message used to transport messages throug a CADET-tunnel (LEGACY) 2618 * 1010-1019 Channel-level Messages
2619 * 1020-1029 Local Client-Service
2620 * 1030-1039 Local Service Monitoring
2621 * 1040-1049 Application Data
2622 * 1050-1059 Reserved
2619 */ 2623 */
2620#define GNUNET_MESSAGE_TYPE_CADET 1000
2621 2624
2622/** 2625/******************************** Connection ********************************/
2623 * Type of message used to send another peer which messages we want to receive
2624 * through a cadet-tunnel (LEGACY)
2625 */
2626#define GNUNET_MESSAGE_TYPE_CADET_HELLO 1001
2627 2626
2628/** 2627/**
2629 * Request the creation of a connection 2628 * Request the creation of a connection
2630 */ 2629 */
2631#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE 1002 2630#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE 1000
2632 2631
2633/** 2632/**
2634 * Send origin an ACK that the connection is complete 2633 * Send origin an ACK that the connection is complete
2635 */ 2634 */
2636#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK 1003 2635#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK 1001
2637 2636
2638/** 2637/**
2639 * Notify that a connection is no longer valid 2638 * Notify that a connection is no longer valid
2640 */ 2639 */
2641#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN 1004 2640#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN 1002
2641
2642/**
2643 * Request the destuction of a connection
2644 */
2645#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY 1003
2642 2646
2643/** 2647/**
2644 * At some point, the route will spontaneously change TODO 2648 * At some point, the route will spontaneously change TODO
2645 */ 2649 */
2646#define GNUNET_MESSAGE_TYPE_CADET_PATH_CHANGED 1005 2650#define GNUNET_MESSAGE_TYPE_CADET_PATH_CHANGED 1004
2647 2651
2648/** 2652/**
2649 * Payload data (usually inside a encrypted tunnel). 2653 * Hop-by-hop, connection dependent ACK.
2650 */ 2654 */
2651#define GNUNET_MESSAGE_TYPE_CADET_DATA 1006 2655#define GNUNET_MESSAGE_TYPE_CADET_ACK 1005
2652 2656
2653/** 2657/**
2654 * Confirm payload data end-to-end. 2658 * Poll for a hop-by-hop ACK.
2655 */ 2659 */
2656#define GNUNET_MESSAGE_TYPE_CADET_DATA_ACK 1007 2660#define GNUNET_MESSAGE_TYPE_CADET_POLL 1006
2657 2661
2658/** 2662/**
2659 * Key exchange encapsulation. 2663 * Key exchange encapsulation.
2660 */ 2664 */
2661#define GNUNET_MESSAGE_TYPE_CADET_KX 1008 2665#define GNUNET_MESSAGE_TYPE_CADET_KX 1007
2662 2666
2663/** 2667/**
2664 * Request the destuction of a connection 2668 * Axolotl encrypted data.
2665 */ 2669 */
2666#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY 1009 2670#define GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED 1008
2671
2672/********************************** Channel *********************************/
2667 2673
2668/** 2674/**
2669 * Hop-by-hop, connection dependent ACK. 2675 * Payload data (inside an encrypted tunnel).
2670 */ 2676 */
2671#define GNUNET_MESSAGE_TYPE_CADET_ACK 1010 2677#define GNUNET_MESSAGE_TYPE_CADET_DATA 1010
2672 2678
2673/** 2679/**
2674 * Poll for a hop-by-hop ACK. 2680 * Confirm payload data end-to-end.
2675 */ 2681 */
2676#define GNUNET_MESSAGE_TYPE_CADET_POLL 1011 2682#define GNUNET_MESSAGE_TYPE_CADET_DATA_ACK 1011
2677 2683
2678/** 2684/**
2679 * Announce connection is still alive (direction sensitive). 2685 * Announce connection is still alive (direction sensitive).
2680 */ 2686 */
2681#define GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE 1012 2687#define GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE 1012
2682 2688
2683
2684/** 2689/**
2685 * Ask the cadet service to create a new channel. 2690 * Ask the cadet service to create a new channel.
2686 */ 2691 */
@@ -2701,86 +2706,89 @@ extern "C"
2701 */ 2706 */
2702#define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK 1016 2707#define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK 1016
2703 2708
2704/** 2709/*********************************** Local **********************************/
2705 * Axolotl key exchange.
2706 */
2707#define GNUNET_MESSAGE_TYPE_CADET_AX_KX 1017
2708
2709/**
2710 * Axolotl encrypted data.
2711 */
2712#define GNUNET_MESSAGE_TYPE_CADET_AX 1018
2713 2710
2714/** 2711/**
2715 * Payload client <-> service 2712 * Payload client <-> service
2716 */ 2713 */
2717#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA 1019 2714#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA 1020
2718 2715
2719/** 2716/**
2720 * Local ACK for data. 2717 * Local ACK for data.
2721 */ 2718 */
2722#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK 1020 2719#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK 1021
2723 2720
2724/** 2721/**
2725 * Start listening on a port. 2722 * Start listening on a port.
2726 */ 2723 */
2727#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN 1021 2724#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN 1022
2728 2725
2729/** 2726/**
2730 * Stop listening on a port. 2727 * Stop listening on a port.
2731 */ 2728 */
2732#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE 1022 2729#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE 1023
2730
2731/********************************** Monitor *********************************/
2732
2733 2733
2734/** 2734/**
2735 * Local information about all channels of service. 2735 * Local information about all channels of service.
2736 */ 2736 */
2737#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNELS 1023 2737#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNELS 1030
2738 2738
2739/** 2739/**
2740 * Local information of service about a specific channel. 2740 * Local information of service about a specific channel.
2741 */ 2741 */
2742#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL 1024 2742#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL 1031
2743 2743
2744/** 2744/**
2745 * Local information about all tunnels of service. 2745 * Local information about all tunnels of service.
2746 */ 2746 */
2747#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS 1025 2747#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS 1032
2748 2748
2749/** 2749/**
2750 * Local information of service about a specific tunnel. 2750 * Local information of service about a specific tunnel.
2751 */ 2751 */
2752#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL 1026 2752#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL 1033
2753 2753
2754/** 2754/**
2755 * Local information about all connections of service. 2755 * Local information about all connections of service.
2756 */ 2756 */
2757#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CONNECTIONS 1027 2757#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CONNECTIONS 1034
2758 2758
2759/** 2759/**
2760 * Local information of service about a specific connection. 2760 * Local information of service about a specific connection.
2761 */ 2761 */
2762#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CONNECTION 1028 2762#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CONNECTION 1035
2763 2763
2764/** 2764/**
2765 * Local information about all peers known to the service. 2765 * Local information about all peers known to the service.
2766 */ 2766 */
2767#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS 1029 2767#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS 1036
2768 2768
2769/** 2769/**
2770 * Local information of service about a specific peer. 2770 * Local information of service about a specific peer.
2771 */ 2771 */
2772#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER 1030 2772#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER 1037
2773 2773
2774/** 2774/**
2775 * Traffic (net-cat style) used by the Command Line Interface. 2775 * Debug request.
2776 */ 2776 */
2777#define GNUNET_MESSAGE_TYPE_CADET_CLI 1031 2777#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_DUMP 1038
2778
2779/******************************** Application *******************************/
2778 2780
2779/** 2781/**
2780 * Debug request. 2782 * Traffic (net-cat style) used by the Command Line Interface.
2781 */ 2783 */
2782#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_DUMP 1032 2784#define GNUNET_MESSAGE_TYPE_CADET_CLI 1040
2785
2786/******************************************************************************/
2787
2783 2788
2789/******************************************************************************/
2790/************************************* NAT **********************************/
2791/******************************************************************************/
2784 2792
2785/** 2793/**
2786 * Message to ask NAT service to register a client. 2794 * Message to ask NAT service to register a client.