// 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 New timer architecture. * 2000-09-04 Henner Eisen Prevented x25_output() skb leakage. * 2000-10-27 Henner Eisen MSG_DONTWAIT for fragment allocation. * 2000-11-10 Henner Eisen x25_send_iframe(): re-queued frames * needed cleaned seq-number fields.
*/
staticint x25_pacsize_to_bytes(unsignedint pacsize)
{ int bytes = 1;
if (!pacsize) return 128;
while (pacsize-- > 0)
bytes *= 2;
return bytes;
}
/* * This is where all X.25 information frames pass. * * Returns the amount of user data bytes sent on success * or a negative error code on failure.
*/ int x25_output(struct sock *sk, struct sk_buff *skb)
{ struct sk_buff *skbn; unsignedchar header[X25_EXT_MIN_LEN]; int err, frontlen, len; int sent=0, noblock = X25_SKB_CB(skb)->flags & MSG_DONTWAIT; struct x25_sock *x25 = x25_sk(sk); int header_len = x25->neighbour->extended ? X25_EXT_MIN_LEN :
X25_STD_MIN_LEN; int max_len = x25_pacsize_to_bytes(x25->facilities.pacsize_out);
if (skb->len - header_len > max_len) { /* Save a copy of the Header */
skb_copy_from_linear_data(skb, header, header_len);
skb_pull(skb, header_len);
/* * This procedure is passed a buffer descriptor for an iframe. It builds * the rest of the control part of the frame and then writes it out.
*/ staticvoid x25_send_iframe(struct sock *sk, struct sk_buff *skb)
{ struct x25_sock *x25 = x25_sk(sk);
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.