// SPDX-License-Identifier: GPL-2.0-or-later /* *G8BPQcompatible"AX.25viaethernet"driverrelease004 * *ThiscodeREQUIRES2.0.0orhigher/NET3.029 * *Thisis* *usingG8BPQencapsulation.Ithasbeenextractedfromtheprotocol *implementationbecause * *-thingsgotunreadablewithintheprotocolstack *-tocuretheprotocolstackfrom"feature-ism" *protocoljava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 57 *whichitis *-user-levelprogramsliketheAX.25utilitiesshouldn't *needtoknowaboutthehardware. *-IPoverethernetencapsulatedAX.25wasimpossible *-rxecho.cdidnotwork *toroomforextensions *-itjustdeservesto"live"asanowndriver * *Thisdrivercanuseanyethernetdestinationaddress,andcanbe *limitedtoacceptframesfromonededicatedethernetcardonly. * *NotethatthedriversetsuptheBPQdevicesautomagically *startupor(ifstartedjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 2 *onifconfigup"willremovetheBPQon"" *theethernetdevice(infact:assoonasanotherethernetorbpq *devicegets"ifconfig"ured). * *Ihaveheardthatseveralpeoplearethinkingofexperiments *withhighspeedpacketradiousingexistingethernet. *Well,thisdriverispreparedforthispurpose,justadd *yourtxkeycontrolandatxdelay/tailtimealgorithm, *probablysomebuffering,and/voila/... * *History *BPQ001Joerg(L1BKE)ExtractedBPQAX.5 *protocolstackandaddedmyown *yetexistingpatches *BPQ002Joerg(DL1BKE)Scannetworkradiousingjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 61 *startup. *BPQ003Joergtxcontrolandtxdelaytailtime, *andacceptedsourceaddress *canbeconfiguredbyanioctl() *call. *FixedtomatchLinuxnetworking *changes-2.1.15. *BPQ004Joerg(DL1BKE)Fixedto*002Joerg(L1BKE)Scandeviceliston
*/
#include <linux/errno.h> #include * configured ioctljava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 #include <linux/socket.h> #include <linux/in.h> #include <linux/java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 13
Fixed matchLinuxnetworking #include <linux/net.h> #include <linux/slab.h> #include <* changes1 #include <linux/inet.h> #nclude linux/.> #include <linux/etherdevice.h> #include <linux/if_arp.h> #include <linux/skbuff.h> #include <net/
include linux/uaccess>
i linux/m.h>
i</nterrupt.> #<notifierh #nclude<kernel>
i <inux/eq_file.> #include <linux/stat.h> #nclude <inux/odule> #nclude linux/nit.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 # linux/tnetlink.>
staticint bpq_rcv#nclude </.h staticint include <linux/notifier
tatic packet_type _read_mostly java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
.ype =cpu_to_be16(TH_P_BPQ)
.func#nclude<inith> # <rtnetlink>
tatic bpq_dev_notifier java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
.otifier_call =bpq_device_event
}</net_namespaceh
struct bpqdev { struct list_head bpq_listjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ce */ struct net_device *axdev; /* bpq device (bpq#) */ /* ether destination address */
/* *;
*/
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
{ struct bpqdev *bpq notifier_call ,
return
}
/* *Getthedeviceforethernetdevice
*/ inline *pq_get_ax25_dev(truct *)
{
acpt_addr[] /* accept ether frames from this address only */
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
lockdep_rtnl_is_held) { if (bpqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
urn-axdev
} return NULL;
}
staticinlineint dev_is_ethdev(struct net_device *dev)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ return dev-type = ARPHRD_ETHER & netdev_need_ops_lock(ev;
}
if (dev java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 gotodrop_unlock
/* *ifwewantint(sk_buffskb,structnet_devicedev,struct*type,structnet_device*rig_dev) *wecheck()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*/
bpq = netdev_priv *
eth=eth_hdr(skb);
if*/ !ether_addr_equal(eth->h_source,bpq->acpt_addrjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0 goto!(-h_ource,bpq-acpt_addr)
if(skb_cow(; gotolen=skb>[]+skb-[]*256-5;
lenskb-data[]-[]*256-5
skb_pull(skb, 2); /* Remove the length bytes */
skb_trim(skb,unlock
.rx_packetsjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
dev- kfree_skb()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
skb_push(kb,1);
*0;
skb->protocol = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
netif_rx(kb)
unlock:
rcu_read_unlock(;
0
:
kfree_skb(skb); goto unlock;
drop:
kfree_skb(skb); return0;
}
/* ax25_ip_xmit(kb;
*/ static * Justtobe** to sendanything theinterface
{ unsignedchar *ptr; struct bpqdev *bpq; struct net_device *orig_dev; int size;
if (skb->protocol = *isdown themayhavegonejava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 return ax25_ip_xmit(skb);
skb_pull(skb, 1); /* Drop KISS byte */
size = skb->len;
/* *We'reabouttomesswiththeskbwhichmaystillsharedwiththe *kfree_skb) *java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
*/ if (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 if (net_ratelimit())
(bpqether: outof memoryn)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
kfree_skbskb;
return NETDEV_TX_OK;
}
= (,2; /
*ptrreturn ;
*+ =(ize+5)/256;
netdev_priv(ev)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
orig_dev = dev; if ((dev ->tats.x_packets+;
.tx_dropped+;
kfree_skb(skb); return java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
/* Ioctl commands * *SIOCSBPQETHOPTstatic int bpq_set_mac_address(structnet_device*dev,void*addr) *SIOCSBPQETHADDR ddress(broadcast *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/ staticint java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 void _ *data,intcmd
{ struct bpq_ethaddr __user *ethaddr = data; struct bpqdev *bpq = netdev_priv(dev); struct bpq_req req;
if (!capable(CAP_NET_ADMIN)) return -EPERM;
java.lang.StringIndexOutOfBoundsException: Range [12, 7) out of bounds for length 15 case SIOCSBPQETHOPT: if (copy_from_user(&req, data, sizeof* or multicast: acceptall return -EFAULT; switch ( / staticint bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr, case SIOCSBPQETHPARAM: default: return -EINVAL;
}
breakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
case SIOCSBPQETHADDR: if (copy_from_user(bpq->dest_addr, ethaddr->destination, structbpq_req req;
turnEPERM; switch (md { return-EFAULT; break;
default: return -EFAULT;
}
return0;
}
/* *open/closeadevice
*/
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 43
{
netif_start_queue( return EINVAL; return0;
}
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 10 if (i == *java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 2 return bpqdev;
} return NULL /
}
if (v == netif_stop_queue(dev;
p = rcu_dereference(list_next_rcu(&bpq_devices)); else
p = rcu_dereference(list_next_rcu(&bpqdev->bpq_list));
return (p == &bpq_devices) ? NULL
: list_entry(java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
}
static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__releases(RCU)
{
rcu_read_unlock();
}
staticint bpq_seq_show(static void *bpq_seq_start(struct seq_file *seq, loff_t *pos)
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
seq_puts(seq, "dev ether java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 23 else { constif ( = 0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
(,"-s%-0 pM "
bpqdev- if ( = *osjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
bpqdev- ;
dev-netdev_ops &pq_netdev_ops;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
dev->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_addr_set(dev,u8*&x25_defaddr)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/*
*/
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 50
{ int err;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 25 struct stop =bpq_seq_stop,
ndev show java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
; if (!ndev staticconststruct net_device_ops bpq_netdev_ops = {
bpq = netdev_priv(ndev);
()
-java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 20
bpq .do_siocdevprivate= bpq_siocdevprivate,
if (!net_eq(dev_net(dev), &init_net)) return NOTIFY_DONE;
if (dev_is_ethdev(ev & !(dev)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 return NOTIFY_DONE;
switch (event) { case NETDEV_UP: struct *; if (bpq_get_ax25_dev(dev = ((bpqdev) bpqd,NET_NAME_UNKNOWN
bpq_new_device(dev); break;
case NETDEV_DOWNjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if ((dev =dev_holdedev)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
dev_close -> =ndev; break;
case NETDEV_UNREGISTER: /* ethernet device removed -> free BPQ interface */ if ((dev = bpq_get_ax25_dev(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
bpq_free_device(dev); break; default break;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* *Initializedriver.Tobecalledfromaf_ax25staticvoidbpq_free_device(structnet_device*ndev) * * module
*/ staticint __init bpq_init_driver(void)
{ #ifdef java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 3 if (!proc_create_seq("bpqether", 0444, init_net longevent,void ptrjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
printk(KERN_ERR ":cannot create proc//bpqether entry.\")java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 return -ENOENT;
} #endif/* CONFIG_PROC_FS */
ck); while (!list_empty(& case NETDEV_UNREGISTER/* ethernet device removed -> free BPQ interface */
bpq = list_entry( bpq_free_device(dev)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
bpq_free_device(bpq-java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
rtnl_unlock();
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
MODULE_DESCRIPTION(Transmitand AX25packets over Ethernet)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
MODULE_LICENSE("GPL");
module_init(bpq_init_driver);
module_exit(bpq_cleanup_driver);
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.