openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

proxy-service.h (1152B)


      1 /***********************************************************************
      2  *
      3  * 
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      7  */
      8 
      9 #ifndef __PROXY_SERVICE_H__
     10 #define __PROXY_SERVICE_H__
     11 
     12 #include <stdlib.h>
     13 #include <stdio.h>
     14 
     15 /*
     16  * Proxy service control data 
     17  */
     18 struct proxy_ctrl_s; 
     19 
     20 typedef int (*proxy_data_cb_t)(struct proxy_ctrl_s* ctrl, 
     21 			       unsigned char* data, 
     22 			       unsigned int* len); 
     23 
     24 typedef struct proxy_ctrl_s {
     25     proxy_data_cb_t input_cb; 
     26     proxy_data_cb_t output_cb; 
     27     proxy_data_cb_t exit_cb; 
     28     unsigned int max_data_size; 
     29     volatile int exit;
     30 } proxy_ctrl_t; 
     31 
     32 
     33 /*
     34  * Function:
     35  *	proxy_service_readr_start
     36  * Purpose:
     37  *	Start a proxy thread/loop
     38  * Parameters:
     39  *	ctrl	-	Proxy control structure
     40  *	fork	-	Indicates whether a new thread should be created. 
     41  *			TRUE: run loop in a new thread. FALSE: Run loop (blocking)
     42  * Returns:
     43  *	0
     44  * Notes:
     45  */
     46 extern int proxy_service_start(proxy_ctrl_t* ctrl, int fork); 
     47 
     48 
     49 #endif /* __PROXY_SERVICE_H__ */
     50 
     51