Quickly clone firewall rules via API written in C.

I have a need in my work to copy firewall rules from a master router to several dozen other routers. So I wrote this program.

It copies all firewall FILTER, MANGLE and ADDRESS-LIST entries from the hard coded “MASTER” router to the router specified on the command line.

I started with the C API from the wiki by webasdf. I fixed the memory management and added several other routines.

This might be a good example for someone looking to get into programming the API in C.

h0rhay
mk_v1.1.tgz (12.3 KB)

Awesome work. That is some well-documented code.

I’m looking for a new project if anyone needs anything written using the API.

Have you considered simply making a generic, cross platform, full featured (ideally focused to ease of use for the developer) API client with bindings for various other languages (e.g. for a PHP extension, a Node module, an unmanaged .NET assembly, etc.)?

Current implementations aren’t… that… so a new one that is would be awesome.

Sorry. I’m just an old C programmer. Great idea but beyond my abilities. I’m hoping someone needs a program to login to a router and do something. Produce a report or change settings or check something and give a different return value so it can be used in bash scripts. Poll some parameter and dump it to a mysql database.