"flag"
"fmt"
"log"
+ "net"
"os"
+ "regexp"
"sync"
"time"
autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing")
+ autoTossNoACK = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing")
)
log.SetFlags(log.Lshortfile)
flag.Usage = usage
}
}
- for _, ifiName := range ctx.MCDRxIfis {
- if err = ctx.MCDRx(ifiName); err != nil {
- log.Printf("Can not run MCD reception on %s: %s", ifiName, err)
+ ifis, err := net.Interfaces()
+ if err != nil {
+ log.Fatalln("Can not get network interfaces list:", err)
+ }
+ for _, ifiReString := range ctx.MCDRxIfis {
+ ifiRe, err := regexp.CompilePOSIX(ifiReString)
+ if err != nil {
+ log.Fatalf("Can not compile POSIX regexp \"%s\": %s", ifiReString, err)
+ }
+ for _, ifi := range ifis {
+ if ifiRe.MatchString(ifi.Name) {
+ if err = ctx.MCDRx(ifi.Name); err != nil {
+ log.Printf("Can not run MCD reception on %s: %s", ifi.Name, err)
+ }
+ }
}
}
call.AutoTossNoExec || *autoTossNoExec,
call.AutoTossNoTrns || *autoTossNoTrns,
call.AutoTossNoArea || *autoTossNoArea,
+ call.AutoTossNoACK || *autoTossNoACK,
)
}