~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/dccp/ccid.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /net/dccp/ccid.h (Version linux-6.11.5) and /net/dccp/ccid.h (Version linux-6.10.4)


** Warning: Cannot open xref database.

  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 
  2 #ifndef _CCID_H                                   
  3 #define _CCID_H                                   
  4 /*                                                
  5  *  net/dccp/ccid.h                               
  6  *                                                
  7  *  An implementation of the DCCP protocol        
  8  *  Arnaldo Carvalho de Melo <acme@conectiva.c    
  9  *                                                
 10  *  CCID infrastructure                           
 11  */                                               
 12                                                   
 13 #include <net/sock.h>                             
 14 #include <linux/compiler.h>                       
 15 #include <linux/dccp.h>                           
 16 #include <linux/list.h>                           
 17 #include <linux/module.h>                         
 18                                                   
 19 /* maximum value for a CCID (RFC 4340, 19.5) *    
 20 #define CCID_MAX                255               
 21 #define CCID_SLAB_NAME_LENGTH   32                
 22                                                   
 23 struct tcp_info;                                  
 24                                                   
 25 /**                                               
 26  *  struct ccid_operations  -  Interface to Co    
 27  *                                                
 28  *  @ccid_id: numerical CCID ID (up to %CCID_M    
 29  *  @ccid_ccmps: the CCMPS including network/t    
 30  *  @ccid_name: alphabetical identifier string    
 31  *  @ccid_hc_{r,t}x_slab: memory pool for the     
 32  *  @ccid_hc_{r,t}x_obj_size: size of the rece    
 33  *                                                
 34  *  @ccid_hc_{r,t}x_init: CCID-specific initia    
 35  *  @ccid_hc_{r,t}x_exit: CCID-specific cleanu    
 36  *  @ccid_hc_rx_packet_recv: implements the HC    
 37  *  @ccid_hc_{r,t}x_parse_options: parsing rou    
 38  *  @ccid_hc_{r,t}x_insert_options: insert rou    
 39  *  @ccid_hc_tx_packet_recv: implements feedba    
 40  *  @ccid_hc_tx_send_packet: implements the se    
 41  *  @ccid_hc_tx_packet_sent: does accounting f    
 42  *  @ccid_hc_{r,t}x_get_info: INET_DIAG inform    
 43  *  @ccid_hc_{r,t}x_getsockopt: socket options    
 44  */                                               
 45 struct ccid_operations {                          
 46         unsigned char           ccid_id;          
 47         __u32                   ccid_ccmps;       
 48         const char              *ccid_name;       
 49         struct kmem_cache       *ccid_hc_rx_sl    
 50                                 *ccid_hc_tx_sl    
 51         char                    ccid_hc_rx_sla    
 52         char                    ccid_hc_tx_sla    
 53         __u32                   ccid_hc_rx_obj    
 54                                 ccid_hc_tx_obj    
 55         /* Interface Routines */                  
 56         int             (*ccid_hc_rx_init)(str    
 57         int             (*ccid_hc_tx_init)(str    
 58         void            (*ccid_hc_rx_exit)(str    
 59         void            (*ccid_hc_tx_exit)(str    
 60         void            (*ccid_hc_rx_packet_re    
 61                                                   
 62         int             (*ccid_hc_rx_parse_opt    
 63                                                   
 64         int             (*ccid_hc_rx_insert_op    
 65                                                   
 66         void            (*ccid_hc_tx_packet_re    
 67                                                   
 68         int             (*ccid_hc_tx_parse_opt    
 69                                                   
 70         int             (*ccid_hc_tx_send_pack    
 71                                                   
 72         void            (*ccid_hc_tx_packet_se    
 73                                                   
 74         void            (*ccid_hc_rx_get_info)    
 75                                                   
 76         void            (*ccid_hc_tx_get_info)    
 77                                                   
 78         int             (*ccid_hc_rx_getsockop    
 79                                                   
 80                                                   
 81                                                   
 82         int             (*ccid_hc_tx_getsockop    
 83                                                   
 84                                                   
 85                                                   
 86 };                                                
 87                                                   
 88 extern struct ccid_operations ccid2_ops;          
 89 #ifdef CONFIG_IP_DCCP_CCID3                       
 90 extern struct ccid_operations ccid3_ops;          
 91 #endif                                            
 92                                                   
 93 int ccid_initialize_builtins(void);               
 94 void ccid_cleanup_builtins(void);                 
 95                                                   
 96 struct ccid {                                     
 97         struct ccid_operations *ccid_ops;         
 98         char                   ccid_priv[];       
 99 };                                                
100                                                   
101 static inline void *ccid_priv(const struct cci    
102 {                                                 
103         return (void *)ccid->ccid_priv;           
104 }                                                 
105                                                   
106 bool ccid_support_check(u8 const *ccid_array,     
107 int ccid_get_builtin_ccids(u8 **ccid_array, u8    
108 int ccid_getsockopt_builtin_ccids(struct sock     
109                                   char __user     
110                                                   
111 struct ccid *ccid_new(const u8 id, struct sock    
112                                                   
113 static inline int ccid_get_current_rx_ccid(str    
114 {                                                 
115         struct ccid *ccid = dp->dccps_hc_rx_cc    
116                                                   
117         if (ccid == NULL || ccid->ccid_ops ==     
118                 return -1;                        
119         return ccid->ccid_ops->ccid_id;           
120 }                                                 
121                                                   
122 static inline int ccid_get_current_tx_ccid(str    
123 {                                                 
124         struct ccid *ccid = dp->dccps_hc_tx_cc    
125                                                   
126         if (ccid == NULL || ccid->ccid_ops ==     
127                 return -1;                        
128         return ccid->ccid_ops->ccid_id;           
129 }                                                 
130                                                   
131 void ccid_hc_rx_delete(struct ccid *ccid, stru    
132 void ccid_hc_tx_delete(struct ccid *ccid, stru    
133                                                   
134 /*                                                
135  * Congestion control of queued data packets v    
136  *                                                
137  * The TX CCID performs its congestion-control    
138  * queued packet may be sent, using the return    
139  * The following modes are supported via the s    
140  * - timer-based pacing    (CCID returns a del    
141  * - autonomous dequeueing (CCID internally sc    
142  */                                               
143                                                   
144 enum ccid_dequeueing_decision {                   
145         CCID_PACKET_SEND_AT_ONCE =       0x000    
146         CCID_PACKET_DELAY_MAX =          0x0FF    
147         CCID_PACKET_DELAY =              0x100    
148         CCID_PACKET_WILL_DEQUEUE_LATER = 0x200    
149         CCID_PACKET_ERR =                0xF00    
150 };                                                
151                                                   
152 static inline int ccid_packet_dequeue_eval(con    
153 {                                                 
154         if (return_code < 0)                      
155                 return CCID_PACKET_ERR;           
156         if (return_code == 0)                     
157                 return CCID_PACKET_SEND_AT_ONC    
158         if (return_code <= CCID_PACKET_DELAY_M    
159                 return CCID_PACKET_DELAY;         
160         return return_code;                       
161 }                                                 
162                                                   
163 static inline int ccid_hc_tx_send_packet(struc    
164                                          struc    
165 {                                                 
166         if (ccid->ccid_ops->ccid_hc_tx_send_pa    
167                 return ccid->ccid_ops->ccid_hc    
168         return CCID_PACKET_SEND_AT_ONCE;          
169 }                                                 
170                                                   
171 static inline void ccid_hc_tx_packet_sent(stru    
172                                           unsi    
173 {                                                 
174         if (ccid->ccid_ops->ccid_hc_tx_packet_    
175                 ccid->ccid_ops->ccid_hc_tx_pac    
176 }                                                 
177                                                   
178 static inline void ccid_hc_rx_packet_recv(stru    
179                                           stru    
180 {                                                 
181         if (ccid->ccid_ops->ccid_hc_rx_packet_    
182                 ccid->ccid_ops->ccid_hc_rx_pac    
183 }                                                 
184                                                   
185 static inline void ccid_hc_tx_packet_recv(stru    
186                                           stru    
187 {                                                 
188         if (ccid->ccid_ops->ccid_hc_tx_packet_    
189                 ccid->ccid_ops->ccid_hc_tx_pac    
190 }                                                 
191                                                   
192 /**                                               
193  * ccid_hc_tx_parse_options  -  Parse CCID-spe    
194  * @pkt: type of packet that @opt appears on (    
195  * @opt: the CCID-specific option type (RFC 43    
196  * @val: value of @opt                            
197  * @len: length of @val in bytes                  
198  */                                               
199 static inline int ccid_hc_tx_parse_options(str    
200                                            u8     
201 {                                                 
202         if (!ccid || !ccid->ccid_ops->ccid_hc_    
203                 return 0;                         
204         return ccid->ccid_ops->ccid_hc_tx_pars    
205 }                                                 
206                                                   
207 /**                                               
208  * ccid_hc_rx_parse_options  -  Parse CCID-spe    
209  * Arguments are analogous to ccid_hc_tx_parse    
210  */                                               
211 static inline int ccid_hc_rx_parse_options(str    
212                                            u8     
213 {                                                 
214         if (!ccid || !ccid->ccid_ops->ccid_hc_    
215                 return 0;                         
216         return ccid->ccid_ops->ccid_hc_rx_pars    
217 }                                                 
218                                                   
219 static inline int ccid_hc_rx_insert_options(st    
220                                             st    
221 {                                                 
222         if (ccid->ccid_ops->ccid_hc_rx_insert_    
223                 return ccid->ccid_ops->ccid_hc    
224         return 0;                                 
225 }                                                 
226                                                   
227 static inline void ccid_hc_rx_get_info(struct     
228                                        struct     
229 {                                                 
230         if (ccid->ccid_ops->ccid_hc_rx_get_inf    
231                 ccid->ccid_ops->ccid_hc_rx_get    
232 }                                                 
233                                                   
234 static inline void ccid_hc_tx_get_info(struct     
235                                        struct     
236 {                                                 
237         if (ccid->ccid_ops->ccid_hc_tx_get_inf    
238                 ccid->ccid_ops->ccid_hc_tx_get    
239 }                                                 
240                                                   
241 static inline int ccid_hc_rx_getsockopt(struct    
242                                         const     
243                                         u32 __    
244 {                                                 
245         int rc = -ENOPROTOOPT;                    
246         if (ccid != NULL && ccid->ccid_ops->cc    
247                 rc = ccid->ccid_ops->ccid_hc_r    
248                                                   
249         return rc;                                
250 }                                                 
251                                                   
252 static inline int ccid_hc_tx_getsockopt(struct    
253                                         const     
254                                         u32 __    
255 {                                                 
256         int rc = -ENOPROTOOPT;                    
257         if (ccid != NULL && ccid->ccid_ops->cc    
258                 rc = ccid->ccid_ops->ccid_hc_t    
259                                                   
260         return rc;                                
261 }                                                 
262 #endif /* _CCID_H */                              
263                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php