MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / RemoveSourceIP

Method RemoveSourceIP

internal/firewalls/firewall_firewalld.go:202–217  ·  view source on GitHub ↗
(ip string)

Source from the content-addressed store, hash-verified

200}
201
202func (this *Firewalld) RemoveSourceIP(ip string) error {
203 if !this.isReady {
204 return nil
205 }
206
207 var family = "ipv4"
208 if strings.Contains(ip, ":") {
209 family = "ipv6"
210 }
211 for _, action := range []string{"reject", "drop"} {
212 var args = []string{"--remove-rich-rule=rule family='" + family + "' source address='" + ip + "' " + action}
213 var cmd = executils.NewTimeoutCmd(10*time.Second, this.exe, args...)
214 this.pushCmd(cmd, "")
215 }
216 return nil
217}
218
219func (this *Firewalld) pushCmd(cmd *executils.Cmd, denyIP string) {
220 select {

Callers

nothing calls this directly

Calls 2

pushCmdMethod · 0.95
ContainsMethod · 0.45

Tested by

no test coverage detected