We present a general framework for several previously introduced boundary conditions for lattice Boltzmann models, such as the bounce-back rule and the linear and quadratic interpolations. The objectives are twofold: first to give theoretical tools to study the existing link-type boundary conditions and their corresponding accuracy; second to design boundary conditions for general flows which are third-order kinetic accurate. Using these new boundary conditions, Couette and Poiseuille flows are exact solutions of the lattice Boltzmann models for a Reynolds number Re=0 (Stokes limit) for arbitrary inclination with the lattice directions. Numerical comparisons are given for Stokes flows in periodic arrays of spheres and cylinders, linear periodic array of cylinders between moving plates, and for Navier-Stokes flows in periodic arrays of cylinders for Re<200. These results show a significant improvement of the overall accuracy when using the linear interpolations instead of the bounce-back reflection (up to an order of magnitude on the hydrodynamics fields). Further improvement is achieved with the new multireflection boundary conditions, reaching a level of accuracy close to the quasianalytical reference solutions, even for rather modest grid resolutions and few points in the narrowest channels. More important, the pressure and velocity fields in the vicinity of the obstacles are much smoother with multireflection than with the other boundary conditions. Finally the good stability of these schemes is highlighted by some simulations of moving obstacles: a cylinder between flat walls and a sphere in a cylinder.