US President-elect Donald Trump has named Gen James Mattis, a former marine who served in Iraq and Afghanistan, as his defence secretary.