blob: 8108d6dfd14c3ee5bd14f8a4b402cef75f589de9 [file] [log] [blame]
suhasgrao76e8f8c2017-07-12 16:24:33 +05301
2/* Global definations */
3pthread_cond_t cv;
4pthread_mutex_t lock;
5
6#define IND_USR_DAT_LEN 8
7#define IND_USR_DAT_VAL "brcmOLT"
8#define BALCLIENT "bal_client"
9#define BALSERVER "bal_server"
suhasgrao4b31f402017-07-31 00:01:54 +053010#define BAL_DEVICE_STR_LEN 20
suhasgrao76e8f8c2017-07-12 16:24:33 +053011
12/* A linked list (LL) node to store a queue entry */
13struct QNode
14{
suhasgrao4b31f402017-07-31 00:01:54 +053015 int obj_type;
16 char device_id[BAL_DEVICE_STR_LEN];
17 int status;
18 int intf_id;
19 int onu_id;
20 struct QNode *next;
suhasgrao76e8f8c2017-07-12 16:24:33 +053021};
22
suhasgrao4b31f402017-07-31 00:01:54 +053023
suhasgrao76e8f8c2017-07-12 16:24:33 +053024/* The queue, front stores the front node of LL and rear stores ths
suhasgrao4b31f402017-07-31 00:01:54 +053025 last node of LL */
suhasgrao76e8f8c2017-07-12 16:24:33 +053026typedef struct Queue
27{
suhasgrao4b31f402017-07-31 00:01:54 +053028 struct QNode *front, *rear;
suhasgrao76e8f8c2017-07-12 16:24:33 +053029}bal_queue;
30
31/* shared queue */
32bal_queue *shared_queue;
33
34void create_stub_thread();
35bal_queue *createQueue();
suhasgrao4b31f402017-07-31 00:01:54 +053036struct QNode* newNode(int objKey, int status, char *device_id);
37void enQueue(int objKey, struct QNode *temp);
suhasgrao76e8f8c2017-07-12 16:24:33 +053038struct QNode *deQueue();