// SPDX-License-Identifier: GPL-2.0-or-later /* * X.25 Packet Layer release 002 * * This is ALPHA test software. This code may break your machine, * randomly fail to work with new releases, misbehave and/or generally * screw up. It might even work. * * This code REQUIRES 2.1.15 or higher * * History * X.25 001 Jonathan Naylor Started coding. * X.25 002 Jonathan Naylor Centralised disconnection code. * New timer architecture. * 2000-03-20 Daniela Squassoni Disabling/enabling of facilities * negotiation. * 2000-11-10 Henner Eisen Check and reset for out-of-sequence * i-frames.
*/
skb_set_owner_r(skbn, sk);
skb_queue_tail(&sk->sk_receive_queue, skbn); if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk);
return 0;
}
/* * State machine for state 1, Awaiting Call Accepted State. * The handling of the timer(s) is in file x25_timer.c. * Handling of state 0 and connection release is in af_x25.c.
*/ staticint x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{ struct x25_address source_addr, dest_addr; int len; struct x25_sock *x25 = x25_sk(sk);
switch (frametype) { case X25_CALL_ACCEPTED: {
x25_stop_timer(sk);
x25->condition = 0x00;
x25->vs = 0;
x25->va = 0;
x25->vr = 0;
x25->vl = 0;
x25->state = X25_STATE_3;
sk->sk_state = TCP_ESTABLISHED; /* * Parse the data in the frame.
*/ if (!pskb_may_pull(skb, X25_STD_MIN_LEN)) goto out_clear;
skb_pull(skb, X25_STD_MIN_LEN);
len = x25_parse_address_block(skb, &source_addr,
&dest_addr); if (len > 0)
skb_pull(skb, len); elseif (len < 0) goto out_clear;
len = x25_parse_facilities(skb, &x25->facilities,
&x25->dte_facilities,
&x25->vc_facil_mask); if (len > 0)
skb_pull(skb, len); elseif (len < 0) goto out_clear; /* * Copy any Call User Data.
*/ if (skb->len > 0) { if (skb->len > X25_MAX_CUD_LEN) goto out_clear;
/* * State machine for state 2, Awaiting Clear Confirmation State. * The handling of the timer(s) is in file x25_timer.c * Handling of state 0 and connection release is in af_x25.c.
*/ staticint x25_state2_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{ switch (frametype) {
case X25_CLEAR_REQUEST: if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) goto out_clear;
/* * State machine for state 3, Connected State. * The handling of the timer(s) is in file x25_timer.c * Handling of state 0 and connection release is in af_x25.c.
*/ staticint x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype, int ns, int nr, int q, int d, int m)
{ int queued = 0; int modulus; struct x25_sock *x25 = x25_sk(sk);
/* * State machine for state 4, Awaiting Reset Confirmation State. * The handling of the timer(s) is in file x25_timer.c * Handling of state 0 and connection release is in af_x25.c.
*/ staticint x25_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{ struct x25_sock *x25 = x25_sk(sk);
switch (frametype) {
case X25_RESET_REQUEST:
x25_write_internal(sk, X25_RESET_CONFIRMATION);
fallthrough; case X25_RESET_CONFIRMATION: {
x25_stop_timer(sk);
x25->condition = 0x00;
x25->va = 0;
x25->vr = 0;
x25->vs = 0;
x25->vl = 0;
x25->state = X25_STATE_3;
x25_requeue_frames(sk); break;
} case X25_CLEAR_REQUEST: if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) goto out_clear;
/* * State machine for state 5, Call Accepted / Call Connected pending (X25_ACCPT_APPRV_FLAG). * The handling of the timer(s) is in file x25_timer.c * Handling of state 0 and connection release is in af_x25.c.
*/ staticint x25_state5_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{ struct x25_sock *x25 = x25_sk(sk);
switch (frametype) { case X25_CLEAR_REQUEST: if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) {
x25_write_internal(sk, X25_CLEAR_REQUEST);
x25->state = X25_STATE_2;
x25_start_t23timer(sk); return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.