HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with the Mid-Layer 427
21
WORKING WITH THE MID-LAYER
INTRODUCTION The SIP Stack provides a set of functions and function callbacks that enable the
application to interface with some of the low-level elements of the SIP Stack,
such as file descriptors and timers. The Mid-layer API can be divided into three
main groups:
Mid-layer Management API—includes a set of functions
required for construction and destruction of the Mid-layer and
other management functionality.
Mid-layer Timer API—includes a set of functions that enable
the application to set and release timers, and to query the
operating system for its clock.
Mid-layer Select API—includes a set of functions that enable
the application to register file descriptors on the select() bitset
and to run the select() loop at the application level.
THREADING
CONSIDERATIONS
The Mid-layer Manager (Mid-layerMgr) can be constructed before or after the
SIP Stack is constructed, but the SIP Stack and the Mid-layer must be
constructed from the same thread. After the Mid-layer is constructed, you can
call the Mid-layer functionality from any other thread.
MID-LAYER
M
ANAGEMENT API
The Mid-layer Management API enables the application to initialize the Mid-
layerMgr. The Mid-layerMgr should be provided to some of the functions that
deal with file descriptors or timers. You have to initialize the Mid-layerMgr in
order to use the Mid-layer functionality.