House-trap or building trap. Saw it on a ask this old house episode, never seen one in person. They said it was commonplace in old construction to prevent rats from coming into the house.
2022 CPC
1008.0 Building Traps
1008.1 General
Building traps shall not be installed except where required by the Authority Having Jurisdiction. Each building trap where installed shall be provided with a cleanout and with a relieving vent or fresh-air intake on the inlet side of the trap, which needs not be larger than one-half the diameter of the drain to which it connects. Such relieving vent or fresh-air intake shall be carried above grade and terminate in a screened outlet located outside the building.