Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
f90b7ae5
Commit
f90b7ae5
authored
Jan 14, 1998
by
Phil Blundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ash support
parent
1bbe9c59
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
0 deletions
+111
-0
config.in
config.in
+2
-0
lib/ash.c
lib/ash.c
+102
-0
lib/hw.c
lib/hw.c
+7
-0
No files found.
config.in
View file @
f90b7ae5
...
@@ -81,3 +81,5 @@ bool 'AX25 (Packet Radio) support' HAVE_HWAX25 y
...
@@ -81,3 +81,5 @@ bool 'AX25 (Packet Radio) support' HAVE_HWAX25 y
bool 'NET/ROM (Packet Radio) support' HAVE_HWNETROM y
bool 'NET/ROM (Packet Radio) support' HAVE_HWNETROM y
bool 'DLCI/FRAD (Frame Relay) support' HAVE_HWFR y
bool 'DLCI/FRAD (Frame Relay) support' HAVE_HWFR y
bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
bool 'Ash support' HAVE_HWASH y
lib/ash.c
0 → 100644
View file @
f90b7ae5
/*
* lib/ash.c This file contains an implementation of the Ash
* support functions for the NET-2 base distribution.
*/
#include "config.h"
#if HAVE_HWASH
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include "net-support.h"
#include "pathnames.h"
#define EXTERN
#include "net-locale.h"
#undef ARPHRD_ASH64
#define ARPHRD_ASH64 517
#define ASH_ALEN 32
extern
struct
hwtype
ash_hwtype
;
/* Display an Ash address in readable format. */
static
char
*
pr_ash
(
unsigned
char
*
ptr
)
{
static
char
buff
[
128
];
char
*
p
=
buff
;
unsigned
int
i
=
0
;
while
(
ptr
[
i
]
!=
0xc9
&&
(
i
<
ASH_ALEN
))
{
sprintf
(
p
,
"%x:"
,
ptr
[
i
]);
i
++
;
p
+=
2
;
}
if
(
p
!=
buff
)
p
[
-
1
]
=
0
;
else
p
[
0
]
=
0
;
return
buff
;
}
/* Display an Ash socket address. */
static
char
*
pr_sash
(
struct
sockaddr
*
sap
)
{
static
char
buf
[
64
];
if
(
sap
->
sa_family
==
0xFFFF
||
sap
->
sa_family
==
0
)
return
strncpy
(
buf
,
"[NONE SET]"
,
64
);
return
(
pr_ash
(
sap
->
sa_data
));
}
static
int
in_ash
(
char
*
bufp
,
struct
sockaddr
*
sap
)
{
unsigned
char
*
ptr
;
unsigned
int
i
=
0
;
sap
->
sa_family
=
ash_hwtype
.
type
;
ptr
=
sap
->
sa_data
;
while
(
bufp
&&
i
<
32
)
{
char
*
next
;
int
hop
=
strtol
(
bufp
,
&
next
,
16
);
ptr
[
i
++
]
=
hop
;
switch
(
*
next
)
{
case
':'
:
bufp
=
next
+
1
;
break
;
case
0
:
bufp
=
NULL
;
break
;
default:
fprintf
(
stderr
,
"Malformed Ash address"
);
memset
(
ptr
,
0xc9
,
32
);
return
-
1
;
}
}
while
(
i
<
32
)
ptr
[
i
++
]
=
0xc9
;
return
0
;
}
struct
hwtype
ash_hwtype
=
{
"ash"
,
NULL
,
ARPHRD_ASH64
,
ASH_ALEN
,
pr_ash
,
pr_sash
,
in_ash
,
NULL
};
#endif
lib/hw.c
View file @
f90b7ae5
...
@@ -48,6 +48,7 @@ extern struct hwtype tr_hwtype;
...
@@ -48,6 +48,7 @@ extern struct hwtype tr_hwtype;
extern
struct
hwtype
ax25_hwtype
;
extern
struct
hwtype
ax25_hwtype
;
extern
struct
hwtype
netrom_hwtype
;
extern
struct
hwtype
netrom_hwtype
;
extern
struct
hwtype
tunnel_hwtype
;
extern
struct
hwtype
tunnel_hwtype
;
extern
struct
hwtype
ash_hwtype
;
extern
struct
hwtype
ppp_hwtype
;
extern
struct
hwtype
ppp_hwtype
;
...
@@ -69,6 +70,9 @@ static struct hwtype *hwtypes[] = {
...
@@ -69,6 +70,9 @@ static struct hwtype *hwtypes[] = {
&
cslip6_hwtype
,
&
cslip6_hwtype
,
&
adaptive_hwtype
,
&
adaptive_hwtype
,
#endif
#endif
#if HAVE_HWASH
&
ash_hwtype
,
#endif
#if HAVE_HWETHER
#if HAVE_HWETHER
&
ether_hwtype
,
&
ether_hwtype
,
#endif
#endif
...
@@ -117,6 +121,9 @@ void hwinit ()
...
@@ -117,6 +121,9 @@ void hwinit ()
#if HAVE_HWETHER
#if HAVE_HWETHER
ether_hwtype
.
title
=
NLS_CATSAVE
(
catfd
,
etherSet
,
ether_ether
,
"Ethernet"
);
ether_hwtype
.
title
=
NLS_CATSAVE
(
catfd
,
etherSet
,
ether_ether
,
"Ethernet"
);
#endif
#endif
#if HAVE_HWASH
ash_hwtype
.
title
=
NLS_CATSAVE
(
catfd
,
ashSet
,
ash_hw
,
"64Mbps ASH"
);
#endif
#if HAVE_HWAX25
#if HAVE_HWAX25
ax25_hwtype
.
title
=
NLS_CATSAVE
(
catfd
,
ax25Set
,
ax25_hw
,
"AMPR AX.25"
);
ax25_hwtype
.
title
=
NLS_CATSAVE
(
catfd
,
ax25Set
,
ax25_hw
,
"AMPR AX.25"
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment