GNUnet 0.21.1
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
 Address 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 199 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 210 of file gnunet-daemon-exit.c.

Referenced by new_channel(), and new_service_channel().

◆ is_dns

int ChannelState::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.

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

Referenced by check_dns_request(), clean_channel(), handle_dns_request(), and new_channel().

◆ 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 226 of file gnunet-daemon-exit.c.

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

◆ state_key

struct GNUNET_HashCode ChannelState::state_key

Key this state has in the connections_map.

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

Referenced by clean_channel(), and setup_state_record().

◆ serv

struct LocalService* ChannelState::serv

Associated service record, or NULL for no service.

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

Referenced by new_service_channel().

◆ ri

struct RedirectInformation ChannelState::ri

Primary redirection information for this connection.

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

Referenced by get_redirect_state(), and new_service_channel().

◆ 

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 250 of file gnunet-daemon-exit.c.

Referenced by handle_dns_request().

◆ original_id

uint16_t ChannelState::original_id

Original DNS request ID as used by the client.

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

Referenced by handle_dns_request(), and process_dns_result().

◆ my_id

uint16_t ChannelState::my_id

DNS request ID that we used for forwarding.

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

Referenced by clean_channel(), and handle_dns_request().

◆ 

struct { ... } ChannelState::dns

◆ 

union { ... } ChannelState::specifics

◆ search

struct GNUNET_REGEX_Search* ChannelState::search

Active query with REGEX to locate exit.

Definition at line 210 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 221 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 226 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 234 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

◆ 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 245 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 250 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 255 of file gnunet-service-vpn.c.

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

◆ v4

struct in_addr ChannelState::v4

◆ v6

struct in6_addr ChannelState::v6

◆ 

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().

◆ 

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 293 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 298 of file gnunet-service-vpn.c.

Referenced by create_channel_to_destination(), free_channel_state(), get_redirect_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: