Skip to content

Instantly share code, notes, and snippets.

@Sheridan
Created August 7, 2019 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sheridan/77b174cbbcb6314222adedd3111d1304 to your computer and use it in GitHub Desktop.
Save Sheridan/77b174cbbcb6314222adedd3111d1304 to your computer and use it in GitHub Desktop.
NFTables go struct
type AutoGenerated struct {
Nftables []struct {
Table struct {
Family string `json:"family"`
Name string `json:"name"`
Handle int `json:"handle"`
} `json:"table,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
} `json:"chain,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Comment string `json:"comment"`
Expr []struct {
Match struct {
Left struct {
NAMING_FAILED []struct {
Payload struct {
Name string `json:"name"`
Field string `json:"field"`
} `json:"payload,omitempty"`
NAMING_FAILED []string `json:"|,omitempty"`
} `json:"&"`
} `json:"left"`
Right struct {
NAMING_FAILED []string `json:"|"`
} `json:"right"`
Op string `json:"op"`
} `json:"match,omitempty"`
Counter struct {
Packets int `json:"packets"`
Bytes int `json:"bytes"`
} `json:"counter,omitempty"`
Drop interface{} `json:"drop,omitempty"`
} `json:"expr"`
} `json:"rule,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Jump string `json:"jump"`
} `json:"expr"`
} `json:"rule,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Chain struct {
Family string `json:"family"`
Table string `json:"table"`
Name string `json:"name"`
Handle int `json:"handle"`
Type string `json:"type"`
Hook string `json:"hook"`
Prio int `json:"prio"`
Policy string `json:"policy"`
} `json:"chain,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Match struct {
Left struct {
Payload struct {
Name string `json:"name"`
Field string `json:"field"`
} `json:"payload"`
} `json:"left"`
Right struct {
Prefix struct {
Addr string `json:"addr"`
Len int `json:"len"`
} `json:"prefix"`
} `json:"right"`
} `json:"match,omitempty"`
Counter struct {
Packets int `json:"packets"`
Bytes int `json:"bytes"`
} `json:"counter,omitempty"`
Masquerade interface{} `json:"masquerade,omitempty"`
} `json:"expr"`
} `json:"rule,omitempty"`
Rule struct {
Family string `json:"family"`
Table string `json:"table"`
Chain string `json:"chain"`
Handle int `json:"handle"`
Expr []struct {
Match struct {
Left struct {
Payload struct {
Name string `json:"name"`
Field string `json:"field"`
} `json:"payload"`
} `json:"left"`
Right struct {
Prefix struct {
Addr string `json:"addr"`
Len int `json:"len"`
} `json:"prefix"`
} `json:"right"`
} `json:"match,omitempty"`
Counter struct {
Packets int `json:"packets"`
Bytes int `json:"bytes"`
} `json:"counter,omitempty"`
Masquerade interface{} `json:"masquerade,omitempty"`
} `json:"expr"`
} `json:"rule,omitempty"`
} `json:"nftables"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment