1. A computer-executed method for controlling the spread of interests and content in a network, comprising: receiving a packet including a piece of content or an interest for the content, wherein the packet further includes a hierarchically structured variable-length identifier (HSVLI) of the content; identifying, using a longest-matching lookup of the HSVLI, a routing policy applicable to a longest matching prefix of the identifier, wherein the routing policy specifies a condition associated with an originating entity or destination entity of the packet, and a forwarding action corresponding to the condition; and in response to determining that the prefix matches the identifier and that the originating entity or destination entity of the packet satisfies the condition in the routing policy, forwarding the packet according to the forwarding action specified in the routing policy.