I am developing a firewall for Linux as my project. I am able to capture packets and to block them. I am using IPTABLES.
How can I use variables with sprintf instead of hardcoded values?
sprintf(comm, "iptables -A INPUT -s $str -j DROP")
// inplace of:
sprintf(comm, "iptables -A INPUT -s 192.168.0.43 -j DROP")