Commit Graph

276 Commits

Author SHA1 Message Date
Alessandro Boch
6dd9989b51 Allow user to set xfrm state limits (#123)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-18 10:20:27 -07:00
Alessandro Boch
f9bc7a684e Support xfrm state/policy flush (#122)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-13 16:42:24 -07:00
Alessandro Boch
d975f28755 XFRM Get/Delete state/policy should share same code (#119)
- Currently they are not and GET methods are passing
  the wrong structure. Also they are setting the incorrect
  XFRM_F_DUMP flag. Because of this, current get methods
  do not return expected error when query target is not found.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 13:16:26 -07:00
Alessandro Boch
339261d114 Parse link statistics (#118)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 10:53:32 -07:00
Alessandro Boch
ef0e63f64d Fix a bug in selFromPolicy() (#120)
- It assumes Src and Dst *ipNet are always specified

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 10:52:20 -07:00
Alessandro Boch
259a962435 Properly pass IP address flags (#121)
- during ip address configuration

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 10:51:33 -07:00
Alessandro Boch
f116a3048a Use package empty handle for pkg APIs (#117)
- Package methods only need an empty handle.
  Not a regular Handle with a couple of
  sockets creation/delete.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:55:00 -07:00
Alessandro Boch
e361359783 Add String() method to user structures (#116)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:53:16 -07:00
Alessandro Boch
cb0b035c41 Provide method to query for specific policy (#115)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:52:35 -07:00
Alessandro Boch
a123807666 Allow to program L4 fields in policy selector (#113)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 09:19:18 -07:00
Alessandro Boch
14f41c27fa Provide netlink handle (#104)
- Ties to a netlink socket. All client requests
  will re-use same socket. Socket released at
  handle deletion.
- Also network namespace can be specified during
  handle creation. Socket will be opened on the
  specified network namespace.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-08 11:35:49 -07:00
Alessandro Boch
096107b4d7 Implement ip xfrm state get (#114)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-08 11:32:17 -07:00
Alessandro Boch
7ec3682687 Support xfrm state/policy update
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-03 22:52:55 -07:00
Alessandro Boch
18e9389da5 Add Mark field to xrfm state and policy (#110)
* Add Mark to xrfm state

Signed-off-by: Alessandro Boch <aboch@docker.com>

* Add Mark to xfrm policies

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-30 20:31:59 -07:00
Vish Ishaya
d09ee68ad5 Make sure port is big endian (#111)
Fixes #107
2016-04-30 20:30:03 -07:00
Lei Jitang
5693665855 Typo: fix a typo in comment of LinkAdd method (#109)
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-29 22:45:47 -07:00
GennadySpb
3236dc177e Add route table number as significant info about route object (#103) 2016-04-28 13:16:53 -07:00
Vish Ishaya
a632d6dc28 Merge pull request #101 from udhos/master
Fix return of address family in parseAddr helper.
2016-04-05 13:35:17 -07:00
Everton Marques
7f8533eaaf Filter address family correctly in AddrList() based on message family. 2016-03-22 21:46:16 -03:00
Everton Marques
148ac55d0a Fix return of address family in parseAddr helper.
I broke return of family in commit 9462941794
2016-03-21 14:14:59 -03:00
Vishvananda Ishaya
adb0f53af6 Cleanup from golint and go vet 2016-03-19 17:12:26 -07:00
Vish Ishaya
d4955d161c Merge pull request #100 from drzaeus77/master
Fix 32bit warnings in bpf_linux.go
2016-03-18 18:11:41 -07:00
Vish Ishaya
bd7a2d8c10 Merge pull request #90 from udhos/master
AddrSubscribe(): receive updates for changes in link addresses.
2016-03-18 18:11:19 -07:00
Everton Marques
988716e658 Return correct underlying error. 2016-03-18 18:08:51 -03:00
Everton Marques
9462941794 Move common code from AddrList,AddrSubscribe into new helper func parseAddr. 2016-03-18 17:44:53 -03:00
Brenden Blanco
809f74071b Fix 32bit warnings in bpf_linux.go
The underlying struct type is still u64 regardless of architecture, but
the local cast should be to uintptr_t to squelch the warning.
2016-03-18 11:13:40 -07:00
Everton Marques
0499fc4776 Merge remote-tracking branch 'upstream/master' 2016-03-18 14:45:31 -03:00
Vish Ishaya
4fdf23c882 Merge pull request #94 from drzaeus77/master
Add support for BPF filters and actions
2016-03-05 16:02:02 -08:00
Brenden Blanco
719d8ca65a Skip test if bpf syscall is unavailable 2016-02-28 23:52:26 -08:00
Brenden Blanco
17b1e35dbc Add clsact and bpf filter support
New in kernel 4.5 is a type of qdisc for lightweight (no qdisc lock)
ingress/egress parsing, called clsact. Add support for such a qdisc
type.

One primary consumer of clsact is the bpf filter, add support for that
as well.
2016-02-28 23:20:29 -08:00
Brenden Blanco
6f0327edfd Add BPF TcAction support to U32 filter
Current U32 filter only supports redirect action, but the U32 can
support a lot more. Refactor a bit the action generating/parsing logic
to be more generic and add BPF action support.

When creating a U32 filter, one can supply an array of Actions, which
will be executed by the U32 filter in order:
* The new MirredAction implements the same functionality as RedirIndex
  field in the U32 filter, with that static field kept in the struct for
  backwards compatibility.
* A new BpfAction type is added which allows a program with an open bpf
  file descriptor (implementation is out of scope of this patch) to be
  added as well.

Add a test for the above use case which includes one of each type of
action.
2016-02-28 23:12:34 -08:00
Brenden Blanco
1f71a4c2a6 Add some missing tc act flags and structs
Add structs and constants for tca_act_bpf.

Generalize the tc_gen macro as a go struct.
2016-02-26 15:08:04 -08:00
Vish Ishaya
814b43a0c7 Merge pull request #92 from aakso/master
Add support for setting route flags back
2016-02-26 09:06:57 -08:00
Anton Aksola
7ff102806b Add support for setting route flags back
Removed in dfdad47 probably unintentionally.

resolves #93
2016-02-23 13:13:02 +02:00
Vish Ishaya
631962935b Merge pull request #91 from liusdu/git-rid-of
RFC: force AddList to get rid of unexpected information
2016-02-23 01:12:47 -08:00
Vishvananda Ishaya
377a621360 add SetVfHardwareAddr and SetVfVlan to link 2016-02-15 14:31:32 -08:00
Liu Hua
8580636726 add test for addList with wrong family number
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2016-02-14 15:01:37 +00:00
Liu Hua
89b71e9bbf force AddList to get rid of unexpected information
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2016-02-14 14:04:38 +00:00
Vish Ishaya
b495efb88c Merge pull request #88 from ibuildthecloud/no-payload
Do not send nl request data in XfrmStateList
2016-02-10 15:09:20 -08:00
Everton Marques
afa33d45e9 AddrSubscribe(): receive updates for changes in link addresses. 2016-01-28 17:27:24 -02:00
Darren Shepherd
be0a6ea35c Do not send nl attributes in XfrmStateList
Signed-off-by: Darren Shepherd <darren@rancher.com>
2016-01-22 07:52:34 -07:00
Vish Ishaya
5a5eb317d7 Merge pull request #84 from chantra/htbclass_2.6
Htbclass support for 2.6 kernel
2016-01-15 12:59:28 -08:00
chantra
d14228b8a5 Do not use nl specific types in class.go 2016-01-13 22:08:44 -08:00
Vish Ishaya
1281ba6af5 Merge pull request #82 from drzaeus77/nlmsghdr
Add syscall.NlMsghdr to LinkUpdate
2016-01-11 15:58:21 -08:00
Vish Ishaya
51f5cbfc99 Merge pull request #85 from okamototk/support-udpcsum
Support VXLAN udpcsum to enable UDP checksum in outer UDP header.
2016-01-11 15:57:56 -08:00
Takashi Okamoto
06ac83f14a Support VXLAN udpcsum to enable UDP checksum in outer UDP header. 2016-01-09 11:11:08 +09:00
chantra
c68d0f3e3c Return error as part of NewHtbClass 2015-12-25 23:40:22 -08:00
chantra
683203e227 Make htb class work on older kernels (2.6) 2015-12-25 23:19:37 -08:00
Brenden Blanco
5b0e1a0383 Add syscall.NlMsghdr to LinkUpdate
Some header fields are needed in order to use LinkSubscribe, for
instance it is useful to distinguish RTM_ADDLINK from RTM_DELLINK.
2015-12-22 21:19:51 -05:00
Vishvananda Ishaya
bfd70f5564 make the gre test pass 2015-12-18 12:14:58 -08:00