Add addresspool.c code

Some convert to Rust code