From: TIMOTHY POWELL (akmseehv.ahip@mtt.net)
Date: Mon Jul 15 2002 - 15:24:29 EEST
Thanks for the reply.
What I’m wanting to do is write a program to monitor
local packet activity. The main goal is to learn
something new and I thought writing packet applications
would be a good start. From your explanation and from
what I learned this weekend is that listen, listens to
more than just AX25 information which is way more than
I want to do.
My first goal is just to receive packet information and
display it on the screen. I thought I was starting to
understand sockets but with your explanation and
questions I have discovered that I’m not understanding
as much as I had originally thought.
int socket(int domain, int type, int protocol);
So PF_AX25 is the domain, SOCK_SEQPACKET would be the
type of communication. So what protocol is used for
receiving AX25 information, or am I still
misunderstanding sockets?
Here might be a better idea of what I’m trying to do.
I got an old PC that I put linux on with AX25 turned
on, for lack of a better description. I plan to use
the sound card to receive and send packets. First
thing I wanted to do was to write an application for
monitoring the local packet activity. Then move to
more difficult programs as I learn more about it. Are
there any tutorials or documentation specific to AX25
that I could also read along with studying the listen
code? Thanks for your help. I hope this gives you a
better idea of what I want to do.
Timothy
On Mon, 15 July 2002, Craig Small wrote
>
> On Sun, Jul 14, 2002 at 12:01:11PM -0700, TIMOTHY
POWELL wrote:
> > 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)))
>
> listen is doing a low-level (Packet socket)
connection. This is because
> it wants to receive all traffic. Quite often you
don't want something
> as low-level as that.
>
> > 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, <?>) ;
>
> This would make a socket with the protocol family of
AX25 and a type of
> STREAM. AX.25 connections are usually SOCK_SEQPACKET
I don't think
> STREAMs are defined in AX25 land.
>
> > 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
> Not really, it comes to what protocol level the
packets come in at.
> PACKET is pretty low level, I think SOCK_RAW is lower
still though I
> cannot see the difference between them.
>
> > way i wrote the function except for <?> if all i
want
> > to do is create a socket for AX25? <?> is where the
> Create a socket for AX25 to do WHAT? The what is the
essential piece of
> information you are missing and it what we need to
help you.
>
> > I tried to find the function
> > htons(proto) in the code but couldn't so I'm not
sure
> htons? Host to Network (byte order) for Short ints?
> Makes sure the bits are the right way around, intel
gets them back to
> front.
>
> > which protocol to use with AX25. I looked in the
file
> > /ect/protocols but didn't see anything for AX25, but
> /etc/protocols are the protocols that ride on top of
IP
> As you're playing around "below" IP so it won't help
you.
>
> As someone said before, have a look at the existing
code. It may not be
> perfect but it works and gives you a good start. I
can tell you more
> specific things to look at once we know what you're
trying to do.
>
> - Craig
> --
> Craig Small VK2XLZ GnuPG:1C1B D893 1418 2AF4 45EE
95CB C76C E5AC 12CA DFA5
> Eye-Net Consulting http://www.eye-net.com.au/
<nlwu@bahcesehir.edu.tr>
> MIEEE <terhi.victor@logonet.com> Debian
developer <gjykp.rseghnb@freakery.com>
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-hams" in
> the body of a message to ztbh@cwnet.com
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
________________________________________________
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 terhi.victor@logonet.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
This archive was generated by hypermail 2b30 : Mon Jul 15 2002 - 15:24:57 EEST