Hamiltonian formulation of the extended Green–Naghdi equations