You should connect to the kernel notification chain for addresses. It available on the kernel level, but you can do it in user space (routing daemons do the same).
Take a look into the subcommands of ip monitor. You can either run it and parse the output to find the events interesting for you or write a piece of netlink code (probably looking into ip's source) do do it entirely in your own program.
Edit. To make it clear: the command is