* Re: AX25 socket question.
@ 2002-07-16 12:19 TIMOTHY POWELL
2002-07-16 18:17 ` Riley Williams
0 siblings, 1 reply; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-16 12:19 UTC (permalink / raw)
To: tpm; +Cc: linux-hams
Thanks for the information, I didn’t realize that I
would have to work at that lower level. But I like
challenges. I’m looking for a book right now to get
that will help explain some things to me, I just wish
there was one specific to AX25. I still plan to work
on the monitoring program, I had planned to get to that
lower level sooner or later but it looks like it will
be sooner. Thanks for the help and information. I
have always used other peoples programs before, but
after a while I finally decided to learn to do it
myself just for the challenge and learning experience.
I appreciate all the replies. Thanks.
Timothy
KD4IKY
On Tue, 16 July 2002, Tomi Manninen OH2BNS wrote
>
> On Mon, 15 Jul 2002, TIMOTHY POWELL wrote:
>
> > 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?
>
> Not necessarily but maybe you're not quite up to what
the different
> protocol layers are.
>
> Just like Craig said, when you need to have an AX.25
socket and do
> information transport between two stations, you need a
> PF_AX25,SOCK_SEQPACKET socket. AX.25 does not support
SOCK_STREAM. It does
> support unnumbered data (UI frames) with SOCK_DGRAM.
>
> But, the point is (as far as I can see) that what you
want to do is not
> (point to point) information transfer, but network
monitoring. When doing
> that you actually do not want to have a socket that
corresponds to the
> higher level protocol but you want a socket to see
the data from the
> device driver. That is what "listen" does.
>
> The same thing applies to applications that monitor
for example the
> internet traffic in your local ethernet segment (eg.
ethereal). They can't
> use PF_INET sockets but something lower level.
>
> The listen program uses PF_PACKET as the domain and
SOCK_PACKET as the
> type. This is actually deprecated in new kernels but
still works (see
> packet(7) manual page for more details). Anyway the
general idea is that
> you need to interpret the raw data from the device
driver to do your
> monitoring. PF_PACKET,SOCK_PACKET socket handles the
device dependent part
> for you, basically removing the KISS command byte
when using a KISS TNC
> and maybe something else for other packet radio
drivers, but the actual
> AX.25 and higher level protocol/data interpretation
is left to you (feel
> free to copy from "listen").
>
> So writing an application to monitor AX.25 traffic
might not be the
> easiest way to start exploring the world AX.25 as you
really need to do
> the whole protocol decoding in your application.
Writing an application
> for simple information transfer with another packet
radio station is much
> simpler as the kernel handles all the gory protocol
details for you...
>
> But, as already said here, you can always re-use the
code from "listen".
> If you are not interested in the upper level
protocols (above plain AX.25)
> you can modify it accordingly (to just hex dump any
higher level data or
> whatever).
>
> --
> Tomi Manninen Internet: oh2bns@sral.fi
> OH2BNS AX.25:
oh2bns@oh2rbi.fin.eu
> KP20ME04 Amprnet:
oh2bns@oh2rbi.ampr.org
>
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-16 12:19 AX25 socket question TIMOTHY POWELL
@ 2002-07-16 18:17 ` Riley Williams
2002-07-16 20:23 ` jeff
2002-07-17 0:55 ` Bob Nielsen
0 siblings, 2 replies; 11+ messages in thread
From: Riley Williams @ 2002-07-16 18:17 UTC (permalink / raw)
To: TIMOTHY POWELL; +Cc: Linux Ham Radio
Hi Timothy.
> Thanks for the information, I didn't realize that I would have to
> work at that lower level. But I like challenges. I'm looking for a
> book right now to get that will help explain some things to me, I
> just wish there was one specific to AX25.
There is a book specific to AX.25, although whether it is still in print
is a good question. The book in question is "AX.25 Packet Radio Link
Layer Protocol" and explains exactly how the AX.25 protocol works. Also,
failing that, just remember that AX.25 is the LAP-B subset of the HDLC
protocol that is defined by international standard, and one can work out
the relevant details by referring to the HDLC standard and taking the
LAP-B subset whherever a choice is presented.
For a less technical (and probably much more understandable) approach, try
http://www.rsgb.org/shop/acatalog/RSGB_On_Line_Shop_Packet___APRS_18.html
or the equivalent on the ARRL website or your national society if it has
one.
> I still plan to work on the monitoring program, I had planned to get
> to that lower level sooner or later but it looks like it will be
> sooner. Thanks for the help and information. I have always used
> other peoples programs before, but after a while I finally decided
> to learn to do it myself just for the challenge and learning
> experience. I appreciate all the replies. Thanks.
No problem.
Best wishes from Riley.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-16 18:17 ` Riley Williams
@ 2002-07-16 20:23 ` jeff
2002-07-16 21:38 ` Riley Williams
2002-07-17 1:07 ` Bob Nielsen
2002-07-17 0:55 ` Bob Nielsen
1 sibling, 2 replies; 11+ messages in thread
From: jeff @ 2002-07-16 20:23 UTC (permalink / raw)
To: Riley Williams; +Cc: TIMOTHY POWELL, Linux Ham Radio
You'll find it here:
http://www.tapr.org/tapr/html/Fax25.html
Riley Williams wrote:
>
> Hi Timothy.
>
> > Thanks for the information, I didn't realize that I would have to
> > work at that lower level. But I like challenges. I'm looking for a
> > book right now to get that will help explain some things to me, I
> > just wish there was one specific to AX25.
>
> There is a book specific to AX.25, although whether it is still in print
> is a good question. The book in question is "AX.25 Packet Radio Link
> Layer Protocol" and explains exactly how the AX.25 protocol works. Also,
> failing that, just remember that AX.25 is the LAP-B subset of the HDLC
> protocol that is defined by international standard, and one can work out
> the relevant details by referring to the HDLC standard and taking the
> LAP-B subset whherever a choice is presented.
>
> For a less technical (and probably much more understandable) approach, try
> http://www.rsgb.org/shop/acatalog/RSGB_On_Line_Shop_Packet___APRS_18.html
> or the equivalent on the ARRL website or your national society if it has
> one.
>
> > I still plan to work on the monitoring program, I had planned to get
> > to that lower level sooner or later but it looks like it will be
> > sooner. Thanks for the help and information. I have always used
> > other peoples programs before, but after a while I finally decided
> > to learn to do it myself just for the challenge and learning
> > experience. I appreciate all the replies. Thanks.
>
> No problem.
>
> Best wishes from Riley.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Jeff, wd4nmq
wd4nmq@earthlink.net
http://home.earthlink.net/~wd4nmq
iLink client node #10438, iLink sysop link node #14746
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-16 20:23 ` jeff
@ 2002-07-16 21:38 ` Riley Williams
2002-07-17 1:07 ` Bob Nielsen
1 sibling, 0 replies; 11+ messages in thread
From: Riley Williams @ 2002-07-16 21:38 UTC (permalink / raw)
To: jeff; +Cc: Linux Ham Radio
Hi Jeff.
> You'll find it here:
>
> http://www.tapr.org/tapr/html/Fax25.html
Many thanks. I've just had a look and that's later than my printed
version, so I've just downloaded it for reference...
Best wishes from Riley.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-16 20:23 ` jeff
2002-07-16 21:38 ` Riley Williams
@ 2002-07-17 1:07 ` Bob Nielsen
1 sibling, 0 replies; 11+ messages in thread
From: Bob Nielsen @ 2002-07-17 1:07 UTC (permalink / raw)
To: Linux Ham Radio
That was the other one I referred to (actually it has both versions).
Bob, N7XY
On Tue, Jul 16, 2002 at 04:23:13PM -0400, jeff wrote:
> You'll find it here:
>
> http://www.tapr.org/tapr/html/Fax25.html
>
> Riley Williams wrote:
> >
> > Hi Timothy.
> >
> > > Thanks for the information, I didn't realize that I would have to
> > > work at that lower level. But I like challenges. I'm looking for a
> > > book right now to get that will help explain some things to me, I
> > > just wish there was one specific to AX25.
> >
> > There is a book specific to AX.25, although whether it is still in print
> > is a good question. The book in question is "AX.25 Packet Radio Link
> > Layer Protocol" and explains exactly how the AX.25 protocol works. Also,
> > failing that, just remember that AX.25 is the LAP-B subset of the HDLC
> > protocol that is defined by international standard, and one can work out
> > the relevant details by referring to the HDLC standard and taking the
> > LAP-B subset whherever a choice is presented.
> >
> > For a less technical (and probably much more understandable) approach, try
> > http://www.rsgb.org/shop/acatalog/RSGB_On_Line_Shop_Packet___APRS_18.html
> > or the equivalent on the ARRL website or your national society if it has
> > one.
> >
> > > I still plan to work on the monitoring program, I had planned to get
> > > to that lower level sooner or later but it looks like it will be
> > > sooner. Thanks for the help and information. I have always used
> > > other peoples programs before, but after a while I finally decided
> > > to learn to do it myself just for the challenge and learning
> > > experience. I appreciate all the replies. Thanks.
> >
> > No problem.
> >
> > Best wishes from Riley.
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-hams" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> Jeff, wd4nmq
> wd4nmq@earthlink.net
> http://home.earthlink.net/~wd4nmq
> iLink client node #10438, iLink sysop link node #14746
> -
> To unsubscribe from this list: send the line "unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Bob Nielsen, N7XY n7xy@n7xy.net
Bainbridge Island, WA
IOTA NA-065, USI WA-028S
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-16 18:17 ` Riley Williams
2002-07-16 20:23 ` jeff
@ 2002-07-17 0:55 ` Bob Nielsen
1 sibling, 0 replies; 11+ messages in thread
From: Bob Nielsen @ 2002-07-17 0:55 UTC (permalink / raw)
To: Linux Ham Radio
On Tue, Jul 16, 2002 at 07:17:44PM +0100, Riley Williams wrote:
> Hi Timothy.
>
> > Thanks for the information, I didn't realize that I would have to
> > work at that lower level. But I like challenges. I'm looking for a
> > book right now to get that will help explain some things to me, I
> > just wish there was one specific to AX25.
>
> There is a book specific to AX.25, although whether it is still in print
> is a good question. The book in question is "AX.25 Packet Radio Link
> Layer Protocol" and explains exactly how the AX.25 protocol works. Also,
> failing that, just remember that AX.25 is the LAP-B subset of the HDLC
> protocol that is defined by international standard, and one can work out
> the relevant details by referring to the HDLC standard and taking the
> LAP-B subset whherever a choice is presented.
You can find this one at
ftp://tapr.org/general/ax25.doc
There was an update to the specification on the TAPR web site at one
time, but I cannot locate it. Possibly N8UR would know.
73, Bob
--
Bob Nielsen, N7XY n7xy@n7xy.net
Bainbridge Island, WA
IOTA NA-065, USI WA-028S
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
@ 2002-07-15 12:24 TIMOTHY POWELL
2002-07-15 22:38 ` Tomi Manninen OH2BNS
2002-07-17 5:46 ` Craig Small
0 siblings, 2 replies; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-15 12:24 UTC (permalink / raw)
To: csmall; +Cc: linux-hams
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/
<csmall@eye-net.com.au>
> MIEEE <csmall@ieee.org> Debian
developer <csmall@debian.org>
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-15 12:24 TIMOTHY POWELL
@ 2002-07-15 22:38 ` Tomi Manninen OH2BNS
2002-07-17 5:46 ` Craig Small
1 sibling, 0 replies; 11+ messages in thread
From: Tomi Manninen OH2BNS @ 2002-07-15 22:38 UTC (permalink / raw)
To: TIMOTHY POWELL; +Cc: linux-hams
On Mon, 15 Jul 2002, TIMOTHY POWELL wrote:
> 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?
Not necessarily but maybe you're not quite up to what the different
protocol layers are.
Just like Craig said, when you need to have an AX.25 socket and do
information transport between two stations, you need a
PF_AX25,SOCK_SEQPACKET socket. AX.25 does not support SOCK_STREAM. It does
support unnumbered data (UI frames) with SOCK_DGRAM.
But, the point is (as far as I can see) that what you want to do is not
(point to point) information transfer, but network monitoring. When doing
that you actually do not want to have a socket that corresponds to the
higher level protocol but you want a socket to see the data from the
device driver. That is what "listen" does.
The same thing applies to applications that monitor for example the
internet traffic in your local ethernet segment (eg. ethereal). They can't
use PF_INET sockets but something lower level.
The listen program uses PF_PACKET as the domain and SOCK_PACKET as the
type. This is actually deprecated in new kernels but still works (see
packet(7) manual page for more details). Anyway the general idea is that
you need to interpret the raw data from the device driver to do your
monitoring. PF_PACKET,SOCK_PACKET socket handles the device dependent part
for you, basically removing the KISS command byte when using a KISS TNC
and maybe something else for other packet radio drivers, but the actual
AX.25 and higher level protocol/data interpretation is left to you (feel
free to copy from "listen").
So writing an application to monitor AX.25 traffic might not be the
easiest way to start exploring the world AX.25 as you really need to do
the whole protocol decoding in your application. Writing an application
for simple information transfer with another packet radio station is much
simpler as the kernel handles all the gory protocol details for you...
But, as already said here, you can always re-use the code from "listen".
If you are not interested in the upper level protocols (above plain AX.25)
you can modify it accordingly (to just hex dump any higher level data or
whatever).
--
Tomi Manninen Internet: oh2bns@sral.fi
OH2BNS AX.25: oh2bns@oh2rbi.fin.eu
KP20ME04 Amprnet: oh2bns@oh2rbi.ampr.org
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: AX25 socket question.
2002-07-15 12:24 TIMOTHY POWELL
2002-07-15 22:38 ` Tomi Manninen OH2BNS
@ 2002-07-17 5:46 ` Craig Small
1 sibling, 0 replies; 11+ messages in thread
From: Craig Small @ 2002-07-17 5:46 UTC (permalink / raw)
To: TIMOTHY POWELL; +Cc: linux-hams
On Mon, Jul 15, 2002 at 05:24:29AM -0700, TIMOTHY POWELL wrote:
> 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.
Yes, you have to work out what layer you want. listen listens at
the packet layer which is pretty well everything. You then take a
random string of bytes and decode it. Listen is effectively a very dumb
set of protocol stacks, you could consider it a lite version of the
actual protocol stack in the kernel itself.
> 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?
If you are in the land of PF_AX25 you are now talking about a *specfic*
sequence of packets, in other words a single connection. You'd use this
sort of socket to connect to another AX.25 station or to make a daemon
like ax25d. The point is that there is a stream of packets to/from
you and a remote station and this socket is your end of that stream.
The protocol stack in the kernel (essentially between the packet socket
and the ax25 socket) does all the address handling, filtering and
reording for you.
> 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.
OK monitoring local packet activity means you want to do something like
what listen does, so its down to the packet layer for that. While I
called it dumb, listen is quite complex and has a specific task. I'm
not sure if you'd want to go to all that trouble.
I've used the low level sockets for strange programs such as
- network analyzers like listen
- weirdo programs like axdigi
- routing daemons like rspfd
but they are strange and are the exception rather than the rule on how
most programs related to ax25 are used. People that store useless
information may even know the connection of the three (with the
exception of my involvement).
- Craig
--
Craig Small VK2XLZ GnuPG:1C1B D893 1418 2AF4 45EE 95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.eye-net.com.au/ <csmall@eye-net.com.au>
MIEEE <csmall@ieee.org> Debian developer <csmall@debian.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* AX25 socket question.
@ 2002-07-14 19:01 TIMOTHY POWELL
2002-07-15 0:03 ` Craig Small
0 siblings, 1 reply; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-14 19:01 UTC (permalink / raw)
To: linux-hams
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
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: AX25 socket question.
2002-07-14 19:01 TIMOTHY POWELL
@ 2002-07-15 0:03 ` Craig Small
0 siblings, 0 replies; 11+ messages in thread
From: Craig Small @ 2002-07-15 0:03 UTC (permalink / raw)
To: TIMOTHY POWELL; +Cc: linux-hams
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/ <csmall@eye-net.com.au>
MIEEE <csmall@ieee.org> Debian developer <csmall@debian.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-07-17 5:46 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-16 12:19 AX25 socket question TIMOTHY POWELL
2002-07-16 18:17 ` Riley Williams
2002-07-16 20:23 ` jeff
2002-07-16 21:38 ` Riley Williams
2002-07-17 1:07 ` Bob Nielsen
2002-07-17 0:55 ` Bob Nielsen
-- strict thread matches above, loose matches on Subject: below --
2002-07-15 12:24 TIMOTHY POWELL
2002-07-15 22:38 ` Tomi Manninen OH2BNS
2002-07-17 5:46 ` Craig Small
2002-07-14 19:01 TIMOTHY POWELL
2002-07-15 0:03 ` Craig Small
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox