aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/ar-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/rxrpc/ar-internal.h')
-rw-r--r--net/rxrpc/ar-internal.h70
1 files changed, 46 insertions, 24 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index cd6cdbe87125..f0b807a163fa 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -9,6 +9,7 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <net/sock.h>
12#include <rxrpc/packet.h> 13#include <rxrpc/packet.h>
13 14
14#if 0 15#if 0
@@ -124,11 +125,15 @@ enum rxrpc_command {
124 * RxRPC security module interface 125 * RxRPC security module interface
125 */ 126 */
126struct rxrpc_security { 127struct rxrpc_security {
127 struct module *owner; /* providing module */
128 struct list_head link; /* link in master list */
129 const char *name; /* name of this service */ 128 const char *name; /* name of this service */
130 u8 security_index; /* security type provided */ 129 u8 security_index; /* security type provided */
131 130
131 /* Initialise a security service */
132 int (*init)(void);
133
134 /* Clean up a security service */
135 void (*exit)(void);
136
132 /* initialise a connection's security */ 137 /* initialise a connection's security */
133 int (*init_connection_security)(struct rxrpc_connection *); 138 int (*init_connection_security)(struct rxrpc_connection *);
134 139
@@ -268,7 +273,7 @@ struct rxrpc_connection {
268 struct rb_root calls; /* calls on this connection */ 273 struct rb_root calls; /* calls on this connection */
269 struct sk_buff_head rx_queue; /* received conn-level packets */ 274 struct sk_buff_head rx_queue; /* received conn-level packets */
270 struct rxrpc_call *channels[RXRPC_MAXCALLS]; /* channels (active calls) */ 275 struct rxrpc_call *channels[RXRPC_MAXCALLS]; /* channels (active calls) */
271 struct rxrpc_security *security; /* applied security module */ 276 const struct rxrpc_security *security; /* applied security module */
272 struct key *key; /* security for this connection (client) */ 277 struct key *key; /* security for this connection (client) */
273 struct key *server_key; /* security for this service */ 278 struct key *server_key; /* security for this service */
274 struct crypto_skcipher *cipher; /* encryption handle */ 279 struct crypto_skcipher *cipher; /* encryption handle */
@@ -289,7 +294,9 @@ struct rxrpc_connection {
289 RXRPC_CONN_LOCALLY_ABORTED, /* - conn aborted locally */ 294 RXRPC_CONN_LOCALLY_ABORTED, /* - conn aborted locally */
290 RXRPC_CONN_NETWORK_ERROR, /* - conn terminated by network error */ 295 RXRPC_CONN_NETWORK_ERROR, /* - conn terminated by network error */
291 } state; 296 } state;
292 int error; /* error code for local abort */ 297 u32 local_abort; /* local abort code */
298 u32 remote_abort; /* remote abort code */
299 int error; /* local error incurred */
293 int debug_id; /* debug ID for printks */ 300 int debug_id; /* debug ID for printks */
294 unsigned int call_counter; /* call ID counter */ 301 unsigned int call_counter; /* call ID counter */
295 atomic_t serial; /* packet serial number counter */ 302 atomic_t serial; /* packet serial number counter */
@@ -399,7 +406,9 @@ struct rxrpc_call {
399 rwlock_t state_lock; /* lock for state transition */ 406 rwlock_t state_lock; /* lock for state transition */
400 atomic_t usage; 407 atomic_t usage;
401 atomic_t sequence; /* Tx data packet sequence counter */ 408 atomic_t sequence; /* Tx data packet sequence counter */
402 u32 abort_code; /* local/remote abort code */ 409 u32 local_abort; /* local abort code */
410 u32 remote_abort; /* remote abort code */
411 int error; /* local error incurred */
403 enum rxrpc_call_state state : 8; /* current state of call */ 412 enum rxrpc_call_state state : 8; /* current state of call */
404 int debug_id; /* debug ID for printks */ 413 int debug_id; /* debug ID for printks */
405 u8 channel; /* connection channel occupied by this call */ 414 u8 channel; /* connection channel occupied by this call */
@@ -453,7 +462,7 @@ static inline void rxrpc_abort_call(struct rxrpc_call *call, u32 abort_code)
453{ 462{
454 write_lock_bh(&call->state_lock); 463 write_lock_bh(&call->state_lock);
455 if (call->state < RXRPC_CALL_COMPLETE) { 464 if (call->state < RXRPC_CALL_COMPLETE) {
456 call->abort_code = abort_code; 465 call->local_abort = abort_code;
457 call->state = RXRPC_CALL_LOCALLY_ABORTED; 466 call->state = RXRPC_CALL_LOCALLY_ABORTED;
458 set_bit(RXRPC_CALL_EV_ABORT, &call->events); 467 set_bit(RXRPC_CALL_EV_ABORT, &call->events);
459 } 468 }
@@ -478,13 +487,6 @@ int rxrpc_reject_call(struct rxrpc_sock *);
478/* 487/*
479 * ar-ack.c 488 * ar-ack.c
480 */ 489 */
481extern unsigned int rxrpc_requested_ack_delay;
482extern unsigned int rxrpc_soft_ack_delay;
483extern unsigned int rxrpc_idle_ack_delay;
484extern unsigned int rxrpc_rx_window_size;
485extern unsigned int rxrpc_rx_mtu;
486extern unsigned int rxrpc_rx_jumbo_max;
487
488void __rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); 490void __rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool);
489void rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); 491void rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool);
490void rxrpc_process_call(struct work_struct *); 492void rxrpc_process_call(struct work_struct *);
@@ -506,7 +508,7 @@ struct rxrpc_call *rxrpc_get_client_call(struct rxrpc_sock *,
506 unsigned long, int, gfp_t); 508 unsigned long, int, gfp_t);
507struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *, 509struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *,
508 struct rxrpc_connection *, 510 struct rxrpc_connection *,
509 struct rxrpc_host_header *, gfp_t); 511 struct rxrpc_host_header *);
510struct rxrpc_call *rxrpc_find_server_call(struct rxrpc_sock *, unsigned long); 512struct rxrpc_call *rxrpc_find_server_call(struct rxrpc_sock *, unsigned long);
511void rxrpc_release_call(struct rxrpc_call *); 513void rxrpc_release_call(struct rxrpc_call *);
512void rxrpc_release_calls_on_socket(struct rxrpc_sock *); 514void rxrpc_release_calls_on_socket(struct rxrpc_sock *);
@@ -531,8 +533,7 @@ void __exit rxrpc_destroy_all_connections(void);
531struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_transport *, 533struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_transport *,
532 struct rxrpc_host_header *); 534 struct rxrpc_host_header *);
533extern struct rxrpc_connection * 535extern struct rxrpc_connection *
534rxrpc_incoming_connection(struct rxrpc_transport *, struct rxrpc_host_header *, 536rxrpc_incoming_connection(struct rxrpc_transport *, struct rxrpc_host_header *);
535 gfp_t);
536 537
537/* 538/*
538 * ar-connevent.c 539 * ar-connevent.c
@@ -550,8 +551,6 @@ void rxrpc_UDP_error_handler(struct work_struct *);
550/* 551/*
551 * ar-input.c 552 * ar-input.c
552 */ 553 */
553extern const char *rxrpc_pkts[];
554
555void rxrpc_data_ready(struct sock *); 554void rxrpc_data_ready(struct sock *);
556int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool); 555int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool);
557void rxrpc_fast_process_packet(struct rxrpc_call *, struct sk_buff *); 556void rxrpc_fast_process_packet(struct rxrpc_call *, struct sk_buff *);
@@ -610,14 +609,10 @@ int rxrpc_recvmsg(struct socket *, struct msghdr *, size_t, int);
610/* 609/*
611 * ar-security.c 610 * ar-security.c
612 */ 611 */
613int rxrpc_register_security(struct rxrpc_security *); 612int __init rxrpc_init_security(void);
614void rxrpc_unregister_security(struct rxrpc_security *); 613void rxrpc_exit_security(void);
615int rxrpc_init_client_conn_security(struct rxrpc_connection *); 614int rxrpc_init_client_conn_security(struct rxrpc_connection *);
616int rxrpc_init_server_conn_security(struct rxrpc_connection *); 615int rxrpc_init_server_conn_security(struct rxrpc_connection *);
617int rxrpc_secure_packet(const struct rxrpc_call *, struct sk_buff *, size_t,
618 void *);
619int rxrpc_verify_packet(const struct rxrpc_call *, struct sk_buff *, u32 *);
620void rxrpc_clear_conn_security(struct rxrpc_connection *);
621 616
622/* 617/*
623 * ar-skbuff.c 618 * ar-skbuff.c
@@ -637,6 +632,33 @@ struct rxrpc_transport *rxrpc_find_transport(struct rxrpc_local *,
637 struct rxrpc_peer *); 632 struct rxrpc_peer *);
638 633
639/* 634/*
635 * insecure.c
636 */
637extern const struct rxrpc_security rxrpc_no_security;
638
639/*
640 * misc.c
641 */
642extern unsigned int rxrpc_requested_ack_delay;
643extern unsigned int rxrpc_soft_ack_delay;
644extern unsigned int rxrpc_idle_ack_delay;
645extern unsigned int rxrpc_rx_window_size;
646extern unsigned int rxrpc_rx_mtu;
647extern unsigned int rxrpc_rx_jumbo_max;
648
649extern const char *const rxrpc_pkts[];
650extern const s8 rxrpc_ack_priority[];
651
652extern const char *rxrpc_acks(u8 reason);
653
654/*
655 * rxkad.c
656 */
657#ifdef CONFIG_RXKAD
658extern const struct rxrpc_security rxkad;
659#endif
660
661/*
640 * sysctl.c 662 * sysctl.c
641 */ 663 */
642#ifdef CONFIG_SYSCTL 664#ifdef CONFIG_SYSCTL