Obviously, the volume is length times cross-sectional area, so we need only determine what that area will be.
For $h (as in the particular example), you're looking at the area of a circular sector with angle $\theta\in(0,\pi)$ such that $\cos\frac{\theta}{2}=\frac{r-h}{r}$--so given the sign, we have $\sqrt{\frac{1+\cos\theta}{2}}=\frac{r-h}{r}$ as the determining equation--less the area of the triangle formed by 2 radii and the chord on that circular sector. The area of the triangle will be $\frac{1}{2}r^2\sin\theta,$ and the area of the sector will be $\frac{1}{2}r^2\theta,$ so we need only determine $\theta$ and $\sin\theta$ in terms of $r$ and $h$.
$1+\cos\theta=\frac{2(r-h)^2}{r^2}$, so $\cos\theta=\frac{2r^2-4rh+2h^2}{r^2}-1=\frac{r^2-4rh+2h^2}{r^2}$, and so $\theta=\arccos\left(\frac{r^2-4rh+2h^2}{r^2}\right).$ Using Pythagorean identity and the fact that $\sin\theta$ is positive for $\theta\in(0,\pi)$, we find also that $\sin\theta=\sqrt{1-\cos^2\theta}$, which through simplification gives us $\sin\theta=\frac{2\sqrt{2rh-h^2}(r-h)}{r^2}.$
Thus, our volume will be $\frac{1}{2}Lr^2\arccos\left(\frac{r^2-4rh+2h^2}{r^2}\right)-L\sqrt{2rh-h^2}(r-h).$
If you want to extend your answer to the other cases, then obviously, when $r=h$, we have $\frac{1}{2}L\pi r^2$ as the volume. When $r, we will take the whole volume of the tube and subtract a similar volume as we had in the first case, with the one exception being that we'll swap $h$ and $r$ in one term, so that the volume will be $L\pi r^2-\frac{1}{2}Lr^2\arccos\left(\frac{r^2-4rh+2h^2}{r^2}\right)+L\sqrt{2rh-h^2}(h-r).$