  A kinetic equation for a system of elastic hard spheres or disks confined by
a hard wall of arbitrary shape is derived. It is a generalization of the
modified Enskog equation in which the effects of the confinement are taken into
account and it is supposed to be valid up to moderate densities. From the
equation, balance equations for the hydrodynamic fields are derived,
identifying the collisional transfer contributions to the pressure tensor and
heat flux. A Lyapunov functional, $\mathcal{H}[f]$, is identified. For any
solution of the kinetic equation, $\mathcal{H}$ decays monotonically in time
until the system reaches the inhomogeneous equilibrium distribution, that is a
Maxwellian distribution with a the density field consistent with equilibrium
statistical mechanics.
