Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
iproute2
Commits
09954dc6
Commit
09954dc6
authored
Jan 10, 2006
by
shemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IP ntable support and header update.
parent
890fe64e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
19 deletions
+72
-19
ChangeLog
ChangeLog
+8
-0
include/linux/netlink.h
include/linux/netlink.h
+23
-1
include/linux/rtnetlink.h
include/linux/rtnetlink.h
+4
-0
include/linux/tcp.h
include/linux/tcp.h
+0
-16
include/linux/xfrm.h
include/linux/xfrm.h
+29
-0
ip/Makefile
ip/Makefile
+1
-1
ip/ip.c
ip/ip.c
+3
-1
ip/ip_common.h
ip/ip_common.h
+4
-0
No files found.
ChangeLog
View file @
09954dc6
2006-01-10 Masahide NAKAMURA <nakam@linux-ipv6.org>
* Add ip link ntable
2006-01-10 Stephen Hemminger <shemminger@osdl.org>
* Update headers to santized kernel 2.6.15
2006-01-03 Alpt <alpt@freaknet.org>
* Ip man page addition
...
...
include/linux/netlink.h
View file @
09954dc6
...
...
@@ -71,7 +71,8 @@ struct nlmsghdr
#define NLMSG_ALIGNTO 4
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
...
...
@@ -86,6 +87,8 @@ struct nlmsghdr
#define NLMSG_DONE 0x3
/* End of a dump */
#define NLMSG_OVERRUN 0x4
/* Data lost */
#define NLMSG_MIN_TYPE 0x10
/* < 0x10: reserved control messages */
struct
nlmsgerr
{
int
error
;
...
...
@@ -108,5 +111,24 @@ enum {
NETLINK_CONNECTED
,
};
/*
* <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
* +---------------------+- - -+- - - - - - - - - -+- - -+
* | Header | Pad | Payload | Pad |
* | (struct nlattr) | ing | | ing |
* +---------------------+- - -+- - - - - - - - - -+- - -+
* <-------------- nlattr->nla_len -------------->
*/
struct
nlattr
{
__u16
nla_len
;
__u16
nla_type
;
};
#define NLA_ALIGNTO 4
#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
#endif
/* __LINUX_NETLINK_H */
include/linux/rtnetlink.h
View file @
09954dc6
...
...
@@ -864,6 +864,7 @@ enum rtnetlink_groups {
#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
RTNLGRP_IPV4_ROUTE
,
#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
RTNLGRP_NOP1
,
RTNLGRP_IPV6_IFADDR
,
#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
RTNLGRP_IPV6_MROUTE
,
...
...
@@ -874,8 +875,11 @@ enum rtnetlink_groups {
#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
RTNLGRP_DECnet_IFADDR
,
#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
RTNLGRP_NOP2
,
RTNLGRP_DECnet_ROUTE
,
#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
RTNLGRP_NOP3
,
RTNLGRP_NOP4
,
RTNLGRP_IPV6_PREFIX
,
#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
__RTNLGRP_MAX
...
...
include/linux/tcp.h
View file @
09954dc6
...
...
@@ -55,22 +55,6 @@ struct tcphdr {
__u16
urg_ptr
;
};
#define TCP_ACTION_FIN (1 << 7)
enum
{
TCPF_ESTABLISHED
=
(
1
<<
1
),
TCPF_SYN_SENT
=
(
1
<<
2
),
TCPF_SYN_RECV
=
(
1
<<
3
),
TCPF_FIN_WAIT1
=
(
1
<<
4
),
TCPF_FIN_WAIT2
=
(
1
<<
5
),
TCPF_TIME_WAIT
=
(
1
<<
6
),
TCPF_CLOSE
=
(
1
<<
7
),
TCPF_CLOSE_WAIT
=
(
1
<<
8
),
TCPF_LAST_ACK
=
(
1
<<
9
),
TCPF_LISTEN
=
(
1
<<
10
),
TCPF_CLOSING
=
(
1
<<
11
)
};
/*
* The union cast uses a gcc extension to avoid aliasing problems
* (union is compatible to any of its members)
...
...
include/linux/xfrm.h
View file @
09954dc6
...
...
@@ -27,6 +27,22 @@ struct xfrm_id
__u8
proto
;
};
struct
xfrm_sec_ctx
{
__u8
ctx_doi
;
__u8
ctx_alg
;
__u16
ctx_len
;
__u32
ctx_sid
;
char
ctx_str
[
0
];
};
/* Security Context Domains of Interpretation */
#define XFRM_SC_DOI_RESERVED 0
#define XFRM_SC_DOI_LSM 1
/* Security Context Algorithms */
#define XFRM_SC_ALG_RESERVED 0
#define XFRM_SC_ALG_SELINUX 1
/* Selector, used as selector both on policy rules (SPD) and SAs. */
struct
xfrm_selector
...
...
@@ -146,6 +162,18 @@ enum {
#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
/*
* Generic LSM security context for comunicating to user space
* NOTE: Same format as sadb_x_sec_ctx
*/
struct
xfrm_user_sec_ctx
{
__u16
len
;
__u16
exttype
;
__u8
ctx_alg
;
/* LSMs: e.g., selinux == 1 */
__u8
ctx_doi
;
__u16
ctx_len
;
};
struct
xfrm_user_tmpl
{
struct
xfrm_id
id
;
__u16
family
;
...
...
@@ -176,6 +204,7 @@ enum xfrm_attr_type_t {
XFRMA_TMPL
,
/* 1 or more struct xfrm_user_tmpl */
XFRMA_SA
,
XFRMA_POLICY
,
XFRMA_SEC_CTX
,
/* struct xfrm_sec_ctx */
__XFRMA_MAX
#define XFRMA_MAX (__XFRMA_MAX - 1)
...
...
ip/Makefile
View file @
09954dc6
IPOBJ
=
ip.o ipaddress.o iproute.o iprule.o
\
rtm_map.o iptunnel.o ipneigh.o iplink.o
\
rtm_map.o iptunnel.o ipneigh.o ip
ntable.o ip
link.o
\
ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o
\
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o
...
...
ip/ip.c
View file @
09954dc6
...
...
@@ -45,7 +45,7 @@ static void usage(void)
fprintf
(
stderr
,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
\n
"
" ip [ -force ] [-batch filename
\n
"
"where OBJECT := { link | addr | route | rule | neigh | tunnel |
\n
"
"where OBJECT := { link | addr | route | rule | neigh |
ntable |
tunnel |
\n
"
" maddr | mroute | monitor | xfrm }
\n
"
" OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] |
\n
"
" -f[amily] { inet | inet6 | ipx | dnet | link } |
\n
"
...
...
@@ -68,6 +68,8 @@ static const struct cmd {
{
"rule"
,
do_iprule
},
{
"neighbor"
,
do_ipneigh
},
{
"neighbour"
,
do_ipneigh
},
{
"ntable"
,
do_ipntable
},
{
"ntbl"
,
do_ipntable
},
{
"link"
,
do_iplink
},
{
"tunnel"
,
do_iptunnel
},
{
"tunl"
,
do_iptunnel
},
...
...
ip/ip_common.h
View file @
09954dc6
...
...
@@ -6,6 +6,8 @@ extern int print_addrinfo(const struct sockaddr_nl *who,
void
*
arg
);
extern
int
print_neigh
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
);
extern
int
print_ntable
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
);
extern
int
ipaddr_list
(
int
argc
,
char
**
argv
);
extern
int
ipaddr_list_link
(
int
argc
,
char
**
argv
);
extern
int
iproute_monitor
(
int
argc
,
char
**
argv
);
...
...
@@ -13,6 +15,7 @@ extern void iplink_usage(void) __attribute__((noreturn));
extern
void
iproute_reset_filter
(
void
);
extern
void
ipaddr_reset_filter
(
int
);
extern
void
ipneigh_reset_filter
(
void
);
extern
void
ipntable_reset_filter
(
void
);
extern
int
print_route
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
);
extern
int
print_prefix
(
const
struct
sockaddr_nl
*
who
,
...
...
@@ -21,6 +24,7 @@ extern int do_ipaddr(int argc, char **argv);
extern
int
do_iproute
(
int
argc
,
char
**
argv
);
extern
int
do_iprule
(
int
argc
,
char
**
argv
);
extern
int
do_ipneigh
(
int
argc
,
char
**
argv
);
extern
int
do_ipntable
(
int
argc
,
char
**
argv
);
extern
int
do_iptunnel
(
int
argc
,
char
**
argv
);
extern
int
do_iplink
(
int
argc
,
char
**
argv
);
extern
int
do_ipmonitor
(
int
argc
,
char
**
argv
);
...
...
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