Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
feat.h File Reference
#include <linux/types.h>
#include "dccp.h"

Go to the source code of this file.

Data Structures

union  dccp_feat_val
 
struct  dccp_feat_entry
 
struct  ccid_dependency
 

Macros

#define DCCPF_ACK_RATIO_MAX   0xFFFF
 
#define DCCPF_SEQ_WMIN   32
 
#define DCCPF_SEQ_WMAX   0x3FFFFFFFFFFFull
 
#define DCCP_FEAT_MAX_SP_VALS   (DCCP_SINGLE_OPT_MAXLEN - 2)
 
#define DCCP_OPTVAL_MAXLEN   6
 

Enumerations

enum  dccp_feat_type {
  FEAT_AT_RX = 1, FEAT_AT_TX = 2, FEAT_SP = 4, FEAT_NN = 8,
  FEAT_UNKNOWN = 0xFF
}
 
enum  dccp_feat_state {
  FEAT_DEFAULT = 0, FEAT_INITIALISING, FEAT_CHANGING, FEAT_UNSTABLE,
  FEAT_STABLE
}
 

Functions

int dccp_feat_init (struct sock *sk)
 
void dccp_feat_initialise_sysctls (void)
 
int dccp_feat_register_sp (struct sock *sk, u8 feat, u8 is_local, u8 const *list, u8 len)
 
int dccp_feat_parse_options (struct sock *, struct dccp_request_sock *, u8 mand, u8 opt, u8 feat, u8 *val, u8 len)
 
int dccp_feat_clone_list (struct list_head const *, struct list_head *)
 
void dccp_encode_value_var (const u64 value, u8 *to, const u8 len)
 
u64 dccp_decode_value_var (const u8 *bf, const u8 len)
 
u64 dccp_feat_nn_get (struct sock *sk, u8 feat)
 
int dccp_insert_option_mandatory (struct sk_buff *skb)
 
int dccp_insert_fn_opt (struct sk_buff *skb, u8 type, u8 feat, u8 *val, u8 len, bool repeat_first)
 

Variables

unsigned long sysctl_dccp_sequence_window
 
int sysctl_dccp_rx_ccid
 
int sysctl_dccp_tx_ccid
 

Macro Definition Documentation

#define DCCP_FEAT_MAX_SP_VALS   (DCCP_SINGLE_OPT_MAXLEN - 2)

Definition at line 26 of file feat.h.

#define DCCP_OPTVAL_MAXLEN   6

Definition at line 128 of file feat.h.

#define DCCPF_ACK_RATIO_MAX   0xFFFF

Definition at line 21 of file feat.h.

#define DCCPF_SEQ_WMAX   0x3FFFFFFFFFFFull

Definition at line 24 of file feat.h.

#define DCCPF_SEQ_WMIN   32

Definition at line 23 of file feat.h.

Enumeration Type Documentation

Enumerator:
FEAT_DEFAULT 
FEAT_INITIALISING 
FEAT_CHANGING 
FEAT_UNSTABLE 
FEAT_STABLE 

Definition at line 36 of file feat.h.

Enumerator:
FEAT_AT_RX 
FEAT_AT_TX 
FEAT_SP 
FEAT_NN 
FEAT_UNKNOWN 

Definition at line 28 of file feat.h.

Function Documentation

u64 dccp_decode_value_var ( const u8 bf,
const u8  len 
)

Definition at line 26 of file options.c.

void dccp_encode_value_var ( const u64  value,
u8 to,
const u8  len 
)

Definition at line 269 of file options.c.

int dccp_feat_clone_list ( struct list_head const ,
struct list_head  
)

Definition at line 555 of file feat.c.

int dccp_feat_init ( struct sock sk)

dccp_feat_init - Seed feature negotiation with host-specific defaults This initialises global defaults, depending on the value of the sysctls. These can later be overridden by registering changes via setsockopt calls. The last link in the chain is finalise_settings, to make sure that between here and the start of actual feature negotiation no inconsistencies enter.

All features not appearing below use either defaults or are otherwise later adjusted through dccp_feat_finalise_settings().

Definition at line 1440 of file feat.c.

void dccp_feat_initialise_sysctls ( void  )
u64 dccp_feat_nn_get ( struct sock sk,
u8  feat 
)

dccp_feat_nn_get - Query current/pending value of NN feature : DCCP socket of an established connection : NN feature number from dccp_feature_numbers

For a known NN feature, returns value currently being negotiated, or current (confirmed) value if no negotiation is going on.

Definition at line 771 of file feat.c.

int dccp_feat_parse_options ( struct sock sk,
struct dccp_request_sock dreq,
u8  mandatory,
u8  opt,
u8  feat,
u8 val,
u8  len 
)

dccp_feat_parse_options - Process Feature-Negotiation Options : for general use and used by the client during connection setup : used by the server during connection setup : whether was preceded by a Mandatory option : DCCPO_CHANGE_L | DCCPO_CHANGE_R | DCCPO_CONFIRM_L | DCCPO_CONFIRM_R : one of dccp_feature_numbers : value contents of : length of in bytes

Returns 0 on success, a Reset code for ending the connection otherwise.

Definition at line 1394 of file feat.c.

int dccp_feat_register_sp ( struct sock sk,
u8  feat,
u8  is_local,
u8 const list,
u8  len 
)

dccp_feat_register_sp - Register requests to change SP feature values : client or listening socket : one of dccp_feature_numbers : whether the local (1) or remote (0) is meant : array of preferred values, in descending order of preference : length of in bytes

Definition at line 752 of file feat.c.

int dccp_insert_fn_opt ( struct sk_buff skb,
u8  type,
u8  feat,
u8 val,
u8  len,
bool  repeat_first 
)

dccp_insert_fn_opt - Insert single Feature-Negotiation option into : DCCPO_CHANGE_L, DCCPO_CHANGE_R, DCCPO_CONFIRM_L, DCCPO_CONFIRM_R : one out of dccp_feature_numbers : NN value or SP array (preferred element first) to copy : true length of in bytes (excluding first element repetition) : whether to copy the first element of twice

The last argument is used to construct Confirm options, where the preferred value and the preference list appear separately (RFC 4340, 6.3.1). Preference lists are kept such that the preferred entry is always first, so we only need to copy twice, and avoid the overhead of cloning into a bigger array.

Definition at line 536 of file options.c.

int dccp_insert_option_mandatory ( struct sk_buff skb)

dccp_insert_option_mandatory - Mandatory option (5.8.2) Note that since we are using skb_push, this function needs to be called after inserting the option it is supposed to influence (stack order).

Definition at line 513 of file options.c.

Variable Documentation

int sysctl_dccp_rx_ccid
unsigned long sysctl_dccp_sequence_window
int sysctl_dccp_tx_ccid