AX25 socket question.

From: TIMOTHY POWELL (zklome@bicworld.com)
Date: Sun Jul 14 2002 - 22:01:11 EEST

  • Next message: Craig Small: "Re: AX25 socket question."

    Got a question about the below code copied from the
    listen.c file that came with ax25-apps-0.0.4

    if ((s = socket(AF_PACKET, SOCK_PACKET, htons(proto)))
    == -1) {
                    perror("socket");
                    return 1;
            }
    I'm new to sockets so I'm a little confuse. From what
    i read from the man pages about sockets if i want to
    create a socket for ax.25 I would do something similar
    to the following:

    axsock = socket(PF_AX25, SOCK_STREAM, <?>) ;

    I am assuming that AF_PACKET and SOCK_PACKET, used in
    the first piece of code, are just variables used by the
    programmer to create any type socket he wanted, since I
    couldn't find metion of them in the man pages or any
    where else. In my example, axsock, am I correct in the
    way i wrote the function except for <?> if all i want
    to do is create a socket for AX25? <?> is where the
    protocol is sure post to be, which protocol do you use?
     I tried to find the function
    htons(proto) in the code but couldn't so I'm not sure
    which protocol to use with AX25. I looked in the file
    /ect/protocols but didn't see anything for AX25, but
    there was one for radio. Can some one give me
    a little incite on how to create a socket just for
    AX25? Thanks I'll keep looking over the code and
    reading to try and learn as much as possible. Thanks.

    Timothy
    KD4IKY

    ________________________________________________
    PeoplePC: It's for people. And it's just smart.
    http://www.peoplepc.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to qhylv@controlware.be
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Sun Jul 14 2002 - 22:01:37 EEST