An API is provided to an optical networking apparatus to facilitate
uniform access, control and interaction with its multi-protocol optical
networking modules (MPONM) by its applications. Each of the MPONM has a
number of function blocks having corresponding drivers. In response to an
application's request to initialize a MPONM, the initialization function
of the API cooperates with the function block drivers to create a data
structure for the MPONM, and returns a handle of the data structure to
the application. Thereafter, in response to a need to have an operation
performed in the packet filtering function block of a MPONM, the
application makes the request to the API, including with the request the
handle of the data structure of the MPONM. In response, the API allocates
a packet filtering resource to perform the operation, and returns a
handle corresponding to the allocated resource to the application for use
in further requests. When the application is finished with the resource,
the resource is de-allocated by the API.