mirror of https://gerrit.osmocom.org/libosmocore
doxygen: Add documentation for prim.h
This commit is contained in:
parent
a523d14096
commit
eee3790d24
|
@ -1,14 +1,21 @@
|
||||||
#ifndef OSMO_PRIMITIVE_H
|
#ifndef OSMO_PRIMITIVE_H
|
||||||
#define OSMO_PRIMITIVE_H
|
#define OSMO_PRIMITIVE_H
|
||||||
|
|
||||||
|
/*! \defgroup prim Osmocom primitives
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file prim.c */
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
|
|
||||||
|
/*! \brief primitive operation */
|
||||||
enum osmo_prim_operation {
|
enum osmo_prim_operation {
|
||||||
PRIM_OP_REQUEST,
|
PRIM_OP_REQUEST, /*!< \brief request */
|
||||||
PRIM_OP_RESPONSE,
|
PRIM_OP_RESPONSE, /*!< \brief response */
|
||||||
PRIM_OP_INDICATION,
|
PRIM_OP_INDICATION, /*!< \brief indication */
|
||||||
PRIM_OP_CONFIRM,
|
PRIM_OP_CONFIRM, /*!< \brief cofirm */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define _SAP_GSM_SHIFT 24
|
#define _SAP_GSM_SHIFT 24
|
||||||
|
@ -16,13 +23,21 @@ enum osmo_prim_operation {
|
||||||
#define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT)
|
#define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT)
|
||||||
#define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT)
|
#define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT)
|
||||||
|
|
||||||
|
/*! \brief primitive header */
|
||||||
struct osmo_prim_hdr {
|
struct osmo_prim_hdr {
|
||||||
unsigned int sap;
|
unsigned int sap; /*!< \brief Service Access Point */
|
||||||
unsigned int primitive;
|
unsigned int primitive; /*!< \brief Primitive number */
|
||||||
enum osmo_prim_operation operation;
|
enum osmo_prim_operation operation; /*! \brief Primitive Operation */
|
||||||
struct msgb *msg; /* message containing associated data */
|
struct msgb *msg; /*!< \brief \ref msgb containing associated data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*! \brief initialize a primitive header
|
||||||
|
* \param[in,out] oph primitive header
|
||||||
|
* \param[in] sap Service Access Point
|
||||||
|
* \param[in] primtive Primitive Number
|
||||||
|
* \param[in] operation Primitive Operation (REQ/RESP/IND/CONF)
|
||||||
|
* \param[in] msg Message
|
||||||
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap,
|
osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap,
|
||||||
unsigned int primitive, enum osmo_prim_operation operation,
|
unsigned int primitive, enum osmo_prim_operation operation,
|
||||||
|
@ -34,5 +49,7 @@ osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap,
|
||||||
oph->msg = msg;
|
oph->msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! \brief primitive handler callback type */
|
||||||
typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx);
|
typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx);
|
||||||
#endif
|
|
||||||
|
#endif /* OSMO_PRIMITIVE_H */
|
||||||
|
|
Loading…
Reference in New Issue