Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
23951418
Unverified
Commit
23951418
authored
5 years ago
by
Dmitriy A. Gerasimov
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #40 from cellframe/2317
'fix2'
parents
15f2b7a4
bb0110f1
No related branches found
No related tags found
1 merge request
!24
Support 3689
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iputils/ping6_common.c
+30
-30
30 additions, 30 deletions
iputils/ping6_common.c
with
30 additions
and
30 deletions
iputils/ping6_common.c
+
30
−
30
View file @
23951418
/*
*
*
Modified for AF_INET6 by Pedro Roque
*
Modified for AF_INET6 by Pedro Roque
*
*
<roque@di.fc.ul.pt>
*
<roque@di.fc.ul.pt>
*
*
Original copyright notice included bellow
*
Original copyright notice included bellow
*/
/*
...
...
@@ -39,33 +39,33 @@
* SUCH DAMAGE.
*/
/*
*
P I N G . C
*
P I N G . C
*
* Using the InterNet Control Message Protocol (ICMP) "ECHO" facility,
* measure round-trip-delays and packet loss across network paths.
*
* Author -
*
Mike Muuss
*
U. S. Army Ballistic Research Laboratory
*
December, 1983
*
Mike Muuss
*
U. S. Army Ballistic Research Laboratory
*
December, 1983
*
* Status -
*
Public Domain. Distribution Unlimited.
*
Public Domain. Distribution Unlimited.
* Bugs -
*
More statistics could always be gathered.
*
If kernel does not support non-raw ICMP sockets or
*
if -N option is used, this program has to run SUID to ROOT or
*
with net_cap_raw enabled.
*
More statistics could always be gathered.
*
If kernel does not support non-raw ICMP sockets or
*
if -N option is used, this program has to run SUID to ROOT or
*
with net_cap_raw enabled.
*/
#include
"ping.h"
/* IPv6 packet information. */
struct
in6_pktinfo
{
struct
in6_addr
ipi6_addr
;
/* src/dst IPv6 address */
unsigned
int
ipi6_ifindex
;
/* send/recv interface index */
};
//
struct in6_pktinfo
//
{
//
struct in6_addr ipi6_addr;
/* src/dst IPv6 address */
//
unsigned int ipi6_ifindex;
/* send/recv interface index */
//
};
ping_func_set_st
ping6_func_set
=
{
.
send_probe
=
ping6_send_probe
,
...
...
@@ -128,14 +128,14 @@ struct niquery_option {
int
(
*
handler
)(
int
index
,
const
char
*
arg
);
};
#define NIQUERY_OPTION(_name, _has_arg, _data, _handler)
\
{
\
.name = _name,
\
.namelen = sizeof(_name) - 1,
\
.has_arg = _has_arg,
\
.data = _data,
\
.handler = _handler
\
}
#define NIQUERY_OPTION(_name, _has_arg, _data, _handler)
\
{
\
.name = _name,
\
.namelen = sizeof(_name) - 1,
\
.has_arg = _has_arg,
\
.data = _data,
\
.handler = _handler
\
}
static
int
niquery_option_name_handler
(
int
index
__attribute__
((
__unused__
)),
const
char
*
arg
__attribute__
((
__unused__
)));
...
...
@@ -333,8 +333,8 @@ static int niquery_set_subject_type(int type)
return
0
;
}
#define ARRAY_SIZE(array)
(sizeof(array) / sizeof(array[0]))
#define OFFSET_OF(type,elem)
((size_t)&((type *)0)->elem)
#define ARRAY_SIZE(array)
(sizeof(array) / sizeof(array[0]))
#define OFFSET_OF(type,elem)
((size_t)&((type *)0)->elem)
static
int
niquery_option_subject_addr_handler
(
int
index
,
const
char
*
arg
)
{
...
...
@@ -763,7 +763,7 @@ int ping6_run(int argc, char **argv, struct addrinfo *ai, struct socket_st *sock
#endif
/*
*
select icmp echo reply as icmp type to receive
*
select icmp echo reply as icmp type to receive
*/
ICMP6_FILTER_SETBLOCKALL
(
&
filter
);
...
...
@@ -946,7 +946,7 @@ int ping6_receive_error_msg(socket_st *sock)
/*
* pinger --
*
Compose and transmit an ICMP ECHO REQUEST packet. The IP packet
*
Compose and transmit an ICMP ECHO REQUEST packet. The IP packet
* will be added on by the kernel. The ID field is our UNIX process ID,
* and the sequence number is an ascending integer. The first several bytes
* of the data portion are used to hold a UNIX "timeval" struct in VAX
...
...
@@ -1178,7 +1178,7 @@ void pr_niquery_reply(uint8_t *_nih, int len)
/*
* parse_reply --
*
Print out the packet, if it came from us. This logic is necessary
*
Print out the packet, if it came from us. This logic is necessary
* because ALL readers of the ICMP socket get a copy of ALL ICMP packets
* which arrive ('tis only fair). This permits multiple copies of this
* program to be run without having intermingled output (or statistics!).
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment