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
4ed3f006
Commit
4ed3f006
authored
Apr 18, 1999
by
Phil Blundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for `--version'
parent
9ad2aa12
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
15 deletions
+29
-15
ipmaddr.c
ipmaddr.c
+4
-3
iptunnel.c
iptunnel.c
+16
-1
plipconfig.c
plipconfig.c
+2
-2
slattach.c
slattach.c
+7
-9
No files found.
ipmaddr.c
View file @
4ed3f006
...
@@ -54,6 +54,7 @@ static void usage(void)
...
@@ -54,6 +54,7 @@ static void usage(void)
{
{
fprintf
(
stderr
,
_
(
"Usage: ipmaddr [ add | del ] MULTIADDR dev STRING
\n
"
));
fprintf
(
stderr
,
_
(
"Usage: ipmaddr [ add | del ] MULTIADDR dev STRING
\n
"
));
fprintf
(
stderr
,
_
(
" ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]
\n
"
));
fprintf
(
stderr
,
_
(
" ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]
\n
"
));
fprintf
(
stderr
,
_
(
" ipmaddr -V | -version
\n
"
));
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -408,7 +409,7 @@ int main(int argc, char **argv)
...
@@ -408,7 +409,7 @@ int main(int argc, char **argv)
++
show_stats
;
++
show_stats
;
}
else
if
(
matches
(
argv
[
1
],
"-resolve"
)
==
0
)
{
}
else
if
(
matches
(
argv
[
1
],
"-resolve"
)
==
0
)
{
++
resolve_hosts
;
++
resolve_hosts
;
}
else
if
(
matches
(
argv
[
1
],
"-V
"
)
==
0
)
{
}
else
if
(
(
matches
(
argv
[
1
],
"-V"
)
==
0
)
||
matches
(
argv
[
1
],
"--version
"
)
==
0
)
{
version
();
version
();
}
else
}
else
usage
();
usage
();
...
...
iptunnel.c
View file @
4ed3f006
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#include <linux/if_tunnel.h>
#include <linux/if_tunnel.h>
#include "intl.h"
#include "intl.h"
#include "net-support.h"
#include "version.h"
#undef GRE_CSUM
#undef GRE_CSUM
#define GRE_CSUM htons(0x8000)
#define GRE_CSUM htons(0x8000)
...
@@ -56,6 +58,16 @@
...
@@ -56,6 +58,16 @@
#include "utils.h"
#include "utils.h"
char
*
Release
=
RELEASE
,
*
Version
=
"iptunnel 1.0"
,
*
Signature
=
"Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>"
;
static
void
version
(
void
)
{
printf
(
"%s
\n
%s
\n
%s
\n
"
,
Release
,
Version
,
Signature
);
exit
(
E_VERSION
);
}
static
void
usage
(
void
)
__attribute__
((
noreturn
));
static
void
usage
(
void
)
__attribute__
((
noreturn
));
static
void
usage
(
void
)
static
void
usage
(
void
)
...
@@ -63,7 +75,8 @@ static void usage(void)
...
@@ -63,7 +75,8 @@ static void usage(void)
fprintf
(
stderr
,
_
(
"Usage: iptunnel { add | change | del | show } [ NAME ]
\n
"
));
fprintf
(
stderr
,
_
(
"Usage: iptunnel { add | change | del | show } [ NAME ]
\n
"
));
fprintf
(
stderr
,
_
(
" [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]
\n
"
));
fprintf
(
stderr
,
_
(
" [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]
\n
"
));
fprintf
(
stderr
,
_
(
" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]
\n
"
));
fprintf
(
stderr
,
_
(
" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]
\n
"
));
fprintf
(
stderr
,
_
(
" [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev PHYS_DEV ]
\n\n
"
));
fprintf
(
stderr
,
_
(
" [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev PHYS_DEV ]
\n
"
));
fprintf
(
stderr
,
_
(
" iptunnel -V | --version
\n\n
"
));
fprintf
(
stderr
,
_
(
"Where: NAME := STRING
\n
"
));
fprintf
(
stderr
,
_
(
"Where: NAME := STRING
\n
"
));
fprintf
(
stderr
,
_
(
" ADDR := { IP_ADDRESS | any }
\n
"
));
fprintf
(
stderr
,
_
(
" ADDR := { IP_ADDRESS | any }
\n
"
));
fprintf
(
stderr
,
_
(
" TOS := { NUMBER | inherit }
\n
"
));
fprintf
(
stderr
,
_
(
" TOS := { NUMBER | inherit }
\n
"
));
...
@@ -583,6 +596,8 @@ int main(int argc, char **argv)
...
@@ -583,6 +596,8 @@ int main(int argc, char **argv)
++
show_stats
;
++
show_stats
;
}
else
if
(
matches
(
argv
[
1
],
"-resolve"
)
==
0
)
{
}
else
if
(
matches
(
argv
[
1
],
"-resolve"
)
==
0
)
{
++
resolve_hosts
;
++
resolve_hosts
;
}
else
if
((
matches
(
argv
[
1
],
"-V"
)
==
0
)
||
(
matches
(
argv
[
1
],
"--version"
)
==
0
))
{
version
();
}
else
}
else
usage
();
usage
();
argc
--
;
argv
++
;
argc
--
;
argv
++
;
...
...
plipconfig.c
View file @
4ed3f006
...
@@ -65,7 +65,7 @@ void usage(void)
...
@@ -65,7 +65,7 @@ void usage(void)
{
{
fprintf
(
stderr
,
_
(
"Usage: plipconfig [-a] [-i] [-v] interface
\n
"
));
fprintf
(
stderr
,
_
(
"Usage: plipconfig [-a] [-i] [-v] interface
\n
"
));
fprintf
(
stderr
,
_
(
" [nibble NN] [trigger NN]
\n
"
));
fprintf
(
stderr
,
_
(
" [nibble NN] [trigger NN]
\n
"
));
fprintf
(
stderr
,
_
(
" plipconfig -V
\n
"
));
fprintf
(
stderr
,
_
(
" plipconfig -V
| --version
\n
"
));
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
...
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
opt_a
=
1
;
opt_a
=
1
;
if
(
!
strcmp
(
*
argv
,
"-v"
))
if
(
!
strcmp
(
*
argv
,
"-v"
))
opt_v
=
1
;
opt_v
=
1
;
if
(
!
strcmp
(
*
argv
,
"-V"
))
if
(
!
strcmp
(
*
argv
,
"-V"
)
||
!
strcmp
(
*
argv
,
"--version"
)
)
version
();
version
();
argv
++
;
argv
++
;
argc
--
;
argc
--
;
...
...
slattach.c
View file @
4ed3f006
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <getopt.h>
#include <linux/if_slip.h>
#include <linux/if_slip.h>
#if defined(__GLIBC__)
#if defined(__GLIBC__)
...
@@ -543,7 +544,7 @@ usage(void)
...
@@ -543,7 +544,7 @@ usage(void)
"[-o outfill] "
"[-o outfill] "
#endif
#endif
"[-c cmd] [-s speed] [-p protocol] tty | -
\n
"
"[-c cmd] [-s speed] [-p protocol] tty | -
\n
"
" slattach -V
\n
"
;
" slattach -V
| --version
\n
"
;
fprintf
(
stderr
,
usage_msg
);
fprintf
(
stderr
,
usage_msg
);
exit
(
1
);
exit
(
1
);
...
@@ -569,19 +570,16 @@ main(int argc, char *argv[])
...
@@ -569,19 +570,16 @@ main(int argc, char *argv[])
struct
hwtype
*
ht
;
struct
hwtype
*
ht
;
char
*
sp
;
char
*
sp
;
int
s
;
int
s
;
static
struct
option
longopts
[]
=
{
{
"version"
,
0
,
NULL
,
'V'
},
{
NULL
,
0
,
NULL
,
0
}
};
strcpy
(
path
,
""
);
strcpy
(
path
,
""
);
/* Scan command line for any arguments. */
/* Scan command line for any arguments. */
opterr
=
0
;
opterr
=
0
;
while
((
s
=
getopt
(
argc
,
argv
,
"c:ehlLmnp:qs:vdV"
while
((
s
=
getopt_long
(
argc
,
argv
,
"c:ehlLmnp:qs:vdVk:o:"
,
longopts
,
NULL
))
!=
EOF
)
switch
(
s
)
{
#ifdef SIOCSKEEPALIVE
"k:"
#endif
#ifdef SIOCSOUTFILL
"o:"
#endif
))
!=
EOF
)
switch
(
s
)
{
case
'c'
:
case
'c'
:
extcmd
=
optarg
;
extcmd
=
optarg
;
break
;
break
;
...
...
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