Re: config BPQ Ethernet device

From: Chris Leishman (qglpo.howizhsvao@roskapostia.tunk.net)
Date: Tue Jan 16 2001 - 15:03:40 EET

  • Next message: Tomi Manninen OH2BNS: "Re: config BPQ Ethernet device"

    On Tue, Jan 16, 2001 at 12:22:22PM +0200, Tomi Manninen OH2BNS wrote:
    > On Tue, 16 Jan 2001, Chris Leishman wrote:
    >
    > > bpq0 Link encap:AMPR AX.25 HWaddr DUMMY-01
    > > UP RUNNING MTU:256 Metric:1
    > > RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    > > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    > > collisions:0 txqueuelen:0
    > > xxx:~# cat /etc/ax25/axports
    > > # /etc/ax25/axports
    > > #
    > > 1 DUMMY-01 10000000 256 2 BPQ/Linux ethernet
    > > xxx:~# axparms -route list
    > > axconfig: port 1 not active
    > > axparms: no AX.25 port data configured
    > > xxx:~#
    > >
    > > How do I make the port active??
    >
    > You need to give it an IP address.
    >

    Ummm... I thought BPQ used the broadcast address (on linux) to send/receive
    data? I'm not talking about doing IP over AX25 over BPQ over Ethernet - just
    the last three.

    Basically I'm just trying to play with AX25 without using radio's since I
    don't have any.

    I tried using "bpqparms bpq0 -d broadcast -a <ether>" with various values of
    the ethernet address (eg. I tried a random ethernet address and the address
    of the associated ethernet card eth0). However this hasn't seemed to help.

    Here's the problem I'm having...

    The following is some code to try and send a message to the node "DUMMY-2".

    --- axsend.c ------------------------------------
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netax25/ax25.h>
    #include <stdio.h>

    int ax25_aton(const char *cp, struct full_sockaddr_ax25 *fsap);

    int main(void)
    {
            struct full_sockaddr_ax25 sa;
            socklen_t alen;
            char buf[1024] = "This is a message\n";
            int n;
            int fd;

            if ((fd = socket(PF_AX25, SOCK_DGRAM, 0)) < 0)
            {
                    perror("socket");
                    exit(1);
            }

            /*
            if ((alen = ax25_aton("BRDCST-01 VIA DUMMY-1", &sa)) < 0)
            */
            if ((alen = ax25_aton("DUMMY-2", &sa)) < 0)
            {
                    perror("ax25_aton");
                    exit(1);
            }

            if ((connect(fd, (struct sockaddr*) &sa, alen)) < 0)
            {
                    perror("connect");
                    exit(1);
            }

            n = sendto(fd, buf, strlen(buf), 0, (struct sockaddr*)&sa, sizeof(sa));

            if (n < 0)
            {
                    perror("sendto");
                    exit(1);
            }

            printf("sent %d bytes.\n", n);

            return 0;
    }
    -------------------------------------------------

    xxx:~# modprobe bpqether
    xxx:~# ifconfig bpq0 hw ax25 DUMMY-1 up
    xxx:~# bpqparms bpq1 -d broadcast -a 00:80:AD:1B:05:26 # random ether addr
    xxx:~# gcc -Wall axsend.c -o axsend -lax25
    xxx:~# ./axsend
    connect: No route to host
    xxx:~#

    I get the same if I use the "PACKET VIA NOCALL" form or if I provide an
    ethernet address that matches the real ethernet device to bpqparms.

    Thanks again Toni,

    Chris



    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to ykkrfwr@win.be



    This archive was generated by hypermail 2b30 : Tue Jan 16 2001 - 15:06:24 EET