An API is provided to an optical networking apparatus to facilitate
uniform access, control or interaction with its multi-protocol optical
networking modules (MPONM) by its applications. Each of the MPONM has a
number of function blocks having corresponding service routines. In
response to an application's request to initialize a MPONM, the
initialization function of the API cooperates with the function block
service routines 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 a function block of a MPONM,
the application makes the request with an externalized function the API
associated with the function block, including with the request the handle
of the data structure of the MPONM.