Programmable network controller