GNUnet  0.11.x
Data Fields
ChannelState Struct Reference

This struct is saved into connections_map to allow finding the right channel given an IP packet from TUN. More...

Collaboration diagram for ChannelState:
[legend]

Data Fields

struct GNUNET_CADET_Channelchannel
 Cadet channel that is used for this connection. More...
 
struct GNUNET_PeerIdentity peer
 Who is the other end of this channel. More...
 
int is_dns
 GNUNET_NO if this is a channel for TCP/UDP, GNUNET_YES if this is a channel for DNS, GNUNET_SYSERR if the channel is not yet initialized. More...
 
union {
   struct {
      struct GNUNET_CONTAINER_HeapNode *   heap_node
 Heap node for this state in the connections_heap. More...
 
      struct GNUNET_HashCode   state_key
 Key this state has in the connections_map. More...
 
      struct LocalService *   serv
 Associated service record, or NULL for no service. More...
 
      struct RedirectInformation   ri
 Primary redirection information for this connection. More...
 
   }   tcp_udp
 
   struct {
      struct GNUNET_DNSSTUB_RequestSocket *   rs
 Socket we are using to transmit this request (must match if we receive a response). More...
 
      uint16_t   original_id
 Original DNS request ID as used by the client. More...
 
      uint16_t   my_id
 DNS request ID that we used for forwarding. More...
 
   }   dns
 
specifics
 
struct GNUNET_REGEX_Searchsearch
 Active query with REGEX to locate exit. More...
 
struct ChannelMessageQueueEntrytmq_head
 Head of list of messages scheduled for transmission. More...
 
struct ChannelMessageQueueEntrytmq_tail
 Tail of list of messages scheduled for transmission. More...
 
struct DestinationEntry destination
 Destination to which this channel leads. More...
 
int af
 Addess family used for this channel on the local TUN interface. More...
 
int is_established
 Is this channel new (GNUNET_NO), or did we exchange messages with the other side already (GNUNET_YES)? More...
 
unsigned int tmq_length
 Length of the doubly linked 'tmq_head/tmq_tail' list. More...
 
uint8_t protocol
 IPPROTO_TCP or IPPROTO_UDP once bound. More...
 
union {
   struct in_addr   v4
 Address if af is AF_INET. More...
 
   struct in6_addr   v6
 Address if af is AF_INET6. More...
 
source_ip
 IP address of the source on our end, initially uninitialized. More...
 
union {
   struct in_addr   v4
 Address if af is AF_INET. More...
 
   struct in6_addr   v6
 Address if af is AF_INET6. More...
 
destination_ip
 Destination IP address used by the source on our end (this is the IP that we pick freely within the VPN's channel IP range). More...
 
uint16_t source_port
 Source port used by the sender on our end; 0 for uninitialized. More...
 
uint16_t destination_port
 Destination port used by the sender on our end; 0 for uninitialized. More...
 

Detailed Description

This struct is saved into connections_map to allow finding the right channel given an IP packet from TUN.

State we keep for each of our channels.

It is also associated with the channel's closure so we can find it again for the next message from the channel.

Definition at line 202 of file gnunet-daemon-exit.c.

Field Documentation

◆ channel

struct GNUNET_CADET_Channel * ChannelState::channel

◆ peer

struct GNUNET_PeerIdentity ChannelState::peer

Who is the other end of this channel.

FIXME is this needed? Only used for debugging messages

Definition at line 213 of file gnunet-daemon-exit.c.

Referenced by handle_icmp_remote(), handle_icmp_service(), handle_tcp_data(), handle_tcp_remote(), handle_tcp_service(), handle_udp_remote(), handle_udp_service(), new_channel(), and new_service_channel().

◆ is_dns

int ChannelState::is_dns

◆ heap_node

struct GNUNET_CONTAINER_HeapNode * ChannelState::heap_node

Heap node for this state in the connections_heap.

Entry for this entry in the channel_heap, NULL as long as this channel state is not fully bound.

Definition at line 229 of file gnunet-daemon-exit.c.

Referenced by check_icmp_back(), check_tcp_back(), check_udp_back(), free_channel_state(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), and route_packet().

◆ state_key

struct GNUNET_HashCode ChannelState::state_key

Key this state has in the connections_map.

Definition at line 234 of file gnunet-daemon-exit.c.

Referenced by setup_state_record().

◆ serv

struct LocalService* ChannelState::serv

Associated service record, or NULL for no service.

Definition at line 239 of file gnunet-daemon-exit.c.

◆ ri

struct RedirectInformation ChannelState::ri

Primary redirection information for this connection.

Definition at line 244 of file gnunet-daemon-exit.c.

◆ tcp_udp

struct { ... } ChannelState::tcp_udp

◆ rs

struct GNUNET_DNSSTUB_RequestSocket* ChannelState::rs

Socket we are using to transmit this request (must match if we receive a response).

Definition at line 253 of file gnunet-daemon-exit.c.

◆ original_id

uint16_t ChannelState::original_id

Original DNS request ID as used by the client.

Definition at line 258 of file gnunet-daemon-exit.c.

◆ my_id

uint16_t ChannelState::my_id

DNS request ID that we used for forwarding.

Definition at line 263 of file gnunet-daemon-exit.c.

◆ dns

struct { ... } ChannelState::dns

◆ specifics

union { ... } ChannelState::specifics

◆ search

struct GNUNET_REGEX_Search* ChannelState::search

Active query with REGEX to locate exit.

Definition at line 211 of file gnunet-service-vpn.c.

Referenced by create_channel_to_destination(), free_channel_state(), handle_regex_result(), and route_packet().

◆ tmq_head

struct ChannelMessageQueueEntry* ChannelState::tmq_head

Head of list of messages scheduled for transmission.

Definition at line 222 of file gnunet-service-vpn.c.

Referenced by free_channel_state().

◆ tmq_tail

struct ChannelMessageQueueEntry* ChannelState::tmq_tail

Tail of list of messages scheduled for transmission.

Definition at line 227 of file gnunet-service-vpn.c.

Referenced by free_channel_state().

◆ destination

struct DestinationEntry ChannelState::destination

Destination to which this channel leads.

Note that this struct is NOT in the destination_map (but a local copy) and that the 'heap_node' should always be NULL.

Definition at line 235 of file gnunet-service-vpn.c.

Referenced by channel_cleaner(), cleanup_channel(), create_channel_to_destination(), expire_channel(), free_channel_state(), handle_regex_result(), and route_packet().

◆ af

int ChannelState::af

Addess family used for this channel on the local TUN interface.

Definition at line 240 of file gnunet-service-vpn.c.

Referenced by check_icmp_back(), check_udp_back(), create_channel_to_destination(), free_channel_state(), handle_icmp_back(), handle_regex_result(), handle_tcp_back(), handle_udp_back(), and route_packet().

◆ is_established

int ChannelState::is_established

Is this channel new (GNUNET_NO), or did we exchange messages with the other side already (GNUNET_YES)?

Definition at line 246 of file gnunet-service-vpn.c.

Referenced by route_packet().

◆ tmq_length

unsigned int ChannelState::tmq_length

Length of the doubly linked 'tmq_head/tmq_tail' list.

Definition at line 251 of file gnunet-service-vpn.c.

Referenced by free_channel_state().

◆ protocol

uint8_t ChannelState::protocol

IPPROTO_TCP or IPPROTO_UDP once bound.

Definition at line 256 of file gnunet-service-vpn.c.

Referenced by free_channel_state(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), and route_packet().

◆ v4

struct in_addr ChannelState::v4

Address if af is AF_INET.

Definition at line 266 of file gnunet-service-vpn.c.

Referenced by handle_icmp_back(), handle_tcp_back(), handle_udp_back(), make_up_icmpv4_payload(), and route_packet().

◆ v6

struct in6_addr ChannelState::v6

Address if af is AF_INET6.

Definition at line 271 of file gnunet-service-vpn.c.

Referenced by handle_icmp_back(), handle_tcp_back(), handle_udp_back(), make_up_icmpv6_payload(), and route_packet().

◆ source_ip

union { ... } ChannelState::source_ip

IP address of the source on our end, initially uninitialized.

Referenced by free_channel_state(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), and route_packet().

◆ destination_ip

union { ... } ChannelState::destination_ip

Destination IP address used by the source on our end (this is the IP that we pick freely within the VPN's channel IP range).

Referenced by free_channel_state(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), and route_packet().

◆ source_port

uint16_t ChannelState::source_port

Source port used by the sender on our end; 0 for uninitialized.

Definition at line 294 of file gnunet-service-vpn.c.

Referenced by free_channel_state(), handle_tcp_back(), handle_udp_back(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), and route_packet().

◆ destination_port

uint16_t ChannelState::destination_port

Destination port used by the sender on our end; 0 for uninitialized.

Definition at line 299 of file gnunet-service-vpn.c.

Referenced by create_channel_to_destination(), free_channel_state(), handle_tcp_back(), handle_udp_back(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), and route_packet().


The documentation for this struct was generated from the following files: