core: add free function to enumerate network interfaces.

Change-Id: Icd89662afe9e1295cd18a615970c5b4299529b38
Refs: #1306