Beyond Ad Hoc: A Generalized Framework for Middlebox Detection | Synapse