summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/iptables
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-01-08 11:15:46 -0800
committerKevin Krakauer <krakauer@google.com>2020-01-08 11:15:46 -0800
commit1e1921e2acdb7357972257219fdffb9edf17bf55 (patch)
tree12fbd37a90ebf1463277cc8c61ad4606545a7841 /pkg/tcpip/iptables
parent8cc1c35bbdc5c9bd6b3965311497885ce72317a8 (diff)
Minor fixes to comments and logging
Diffstat (limited to 'pkg/tcpip/iptables')
-rw-r--r--pkg/tcpip/iptables/targets.go2
-rw-r--r--pkg/tcpip/iptables/types.go28
2 files changed, 7 insertions, 23 deletions
diff --git a/pkg/tcpip/iptables/targets.go b/pkg/tcpip/iptables/targets.go
index 03c9f19ff..2c3598e3d 100644
--- a/pkg/tcpip/iptables/targets.go
+++ b/pkg/tcpip/iptables/targets.go
@@ -34,7 +34,7 @@ func (UnconditionalDropTarget) Action(packet buffer.VectorisedView) (Verdict, st
return Drop, ""
}
-// PanicTarget just panics.
+// PanicTarget just panics. It represents a target that should be unreachable.
type PanicTarget struct{}
// Actions implements Target.Action.
diff --git a/pkg/tcpip/iptables/types.go b/pkg/tcpip/iptables/types.go
index 76364ff1f..fe0394a31 100644
--- a/pkg/tcpip/iptables/types.go
+++ b/pkg/tcpip/iptables/types.go
@@ -107,20 +107,19 @@ type IPTables struct {
Priorities map[Hook][]string
}
-// A Table defines a set of chains and hooks into the network stack. The
-// currently supported tables are:
-// * nat
-// * mangle
+// A Table defines a set of chains and hooks into the network stack. It is
+// really just a list of rules with some metadata for entrypoints and such.
type Table struct {
- // A table is just a list of rules with some entrypoints.
+ // Rules holds the rules that make up the table.
Rules []Rule
+ // BuiltinChains maps builtin chains to their entrypoints.
BuiltinChains map[Hook]int
+ // Underflows maps builtin chains to their underflow point (i.e. the
+ // rule to execute if the chain returns without a verdict).
Underflows map[Hook]int
- // DefaultTargets map[Hook]int
-
// UserChains holds user-defined chains for the keyed by name. Users
// can give their chains arbitrary names.
UserChains map[string]int
@@ -149,21 +148,6 @@ func (table *Table) SetMetadata(metadata interface{}) {
table.metadata = metadata
}
-//// A Chain defines a list of rules for packet processing. When a packet
-//// traverses a chain, it is checked against each rule until either a rule
-//// returns a verdict or the chain ends.
-////
-//// By convention, builtin chains end with a rule that matches everything and
-//// returns either Accept or Drop. User-defined chains end with Return. These
-//// aren't strictly necessary here, but the iptables tool writes tables this way.
-//type Chain struct {
-// // Name is the chain name.
-// Name string
-
-// // Rules is the list of rules to traverse.
-// Rules []Rule
-//}
-
// A Rule is a packet processing rule. It consists of two pieces. First it
// contains zero or more matchers, each of which is a specification of which
// packets this rule applies to. If there are no matchers in the rule, it