diff options
Diffstat (limited to 'net/rxrpc/ar-internal.h')
| -rw-r--r-- | net/rxrpc/ar-internal.h | 70 |
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 | */ |
| 126 | struct rxrpc_security { | 127 | struct 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 | */ |
| 481 | extern unsigned int rxrpc_requested_ack_delay; | ||
| 482 | extern unsigned int rxrpc_soft_ack_delay; | ||
| 483 | extern unsigned int rxrpc_idle_ack_delay; | ||
| 484 | extern unsigned int rxrpc_rx_window_size; | ||
| 485 | extern unsigned int rxrpc_rx_mtu; | ||
| 486 | extern unsigned int rxrpc_rx_jumbo_max; | ||
| 487 | |||
| 488 | void __rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); | 490 | void __rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); |
| 489 | void rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); | 491 | void rxrpc_propose_ACK(struct rxrpc_call *, u8, u32, bool); |
| 490 | void rxrpc_process_call(struct work_struct *); | 492 | void 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); |
| 507 | struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *, | 509 | struct 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 *); |
| 510 | struct rxrpc_call *rxrpc_find_server_call(struct rxrpc_sock *, unsigned long); | 512 | struct rxrpc_call *rxrpc_find_server_call(struct rxrpc_sock *, unsigned long); |
| 511 | void rxrpc_release_call(struct rxrpc_call *); | 513 | void rxrpc_release_call(struct rxrpc_call *); |
| 512 | void rxrpc_release_calls_on_socket(struct rxrpc_sock *); | 514 | void rxrpc_release_calls_on_socket(struct rxrpc_sock *); |
| @@ -531,8 +533,7 @@ void __exit rxrpc_destroy_all_connections(void); | |||
| 531 | struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_transport *, | 533 | struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_transport *, |
| 532 | struct rxrpc_host_header *); | 534 | struct rxrpc_host_header *); |
| 533 | extern struct rxrpc_connection * | 535 | extern struct rxrpc_connection * |
| 534 | rxrpc_incoming_connection(struct rxrpc_transport *, struct rxrpc_host_header *, | 536 | rxrpc_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 | */ |
| 553 | extern const char *rxrpc_pkts[]; | ||
| 554 | |||
| 555 | void rxrpc_data_ready(struct sock *); | 554 | void rxrpc_data_ready(struct sock *); |
| 556 | int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool); | 555 | int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool); |
| 557 | void rxrpc_fast_process_packet(struct rxrpc_call *, struct sk_buff *); | 556 | void 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 | */ |
| 613 | int rxrpc_register_security(struct rxrpc_security *); | 612 | int __init rxrpc_init_security(void); |
| 614 | void rxrpc_unregister_security(struct rxrpc_security *); | 613 | void rxrpc_exit_security(void); |
| 615 | int rxrpc_init_client_conn_security(struct rxrpc_connection *); | 614 | int rxrpc_init_client_conn_security(struct rxrpc_connection *); |
| 616 | int rxrpc_init_server_conn_security(struct rxrpc_connection *); | 615 | int rxrpc_init_server_conn_security(struct rxrpc_connection *); |
| 617 | int rxrpc_secure_packet(const struct rxrpc_call *, struct sk_buff *, size_t, | ||
| 618 | void *); | ||
| 619 | int rxrpc_verify_packet(const struct rxrpc_call *, struct sk_buff *, u32 *); | ||
| 620 | void 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 | */ | ||
| 637 | extern const struct rxrpc_security rxrpc_no_security; | ||
| 638 | |||
| 639 | /* | ||
| 640 | * misc.c | ||
| 641 | */ | ||
| 642 | extern unsigned int rxrpc_requested_ack_delay; | ||
| 643 | extern unsigned int rxrpc_soft_ack_delay; | ||
| 644 | extern unsigned int rxrpc_idle_ack_delay; | ||
| 645 | extern unsigned int rxrpc_rx_window_size; | ||
| 646 | extern unsigned int rxrpc_rx_mtu; | ||
| 647 | extern unsigned int rxrpc_rx_jumbo_max; | ||
| 648 | |||
| 649 | extern const char *const rxrpc_pkts[]; | ||
| 650 | extern const s8 rxrpc_ack_priority[]; | ||
| 651 | |||
| 652 | extern const char *rxrpc_acks(u8 reason); | ||
| 653 | |||
| 654 | /* | ||
| 655 | * rxkad.c | ||
| 656 | */ | ||
| 657 | #ifdef CONFIG_RXKAD | ||
| 658 | extern 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 |
