实现从KNI中接收上行、下行连接FD的功能。
This commit is contained in:
@@ -1,17 +1,32 @@
|
||||
//#define ALLOC(t,n) (t *)calloc(sizeof(t),(n))
|
||||
/*
|
||||
* @file tfe_utils.h
|
||||
* This file provides common usage marcos and helper functions.
|
||||
*/
|
||||
|
||||
/* Allocates an array of objects using malloc() */
|
||||
#define ALLOC(type, number) \
|
||||
((type *)calloc(sizeof(type), number))
|
||||
#pragma once
|
||||
#include <MESA/MESA_handle_logger.h>
|
||||
|
||||
#define TFE_STRING_MAX 2048
|
||||
#define TFE_SYMBOL_MAX 64
|
||||
|
||||
#ifndef TFE_CONFIG_BACKLOG_DEFAULT
|
||||
#define TFE_CONFIG_BACKLOG_DEFAULT 20
|
||||
#endif
|
||||
|
||||
#define ALLOC(type, number) ((type *)calloc(sizeof(type), number))
|
||||
|
||||
#define likely(expr) __builtin_expect((expr), 1)
|
||||
#define unlikely(expr) __builtin_expect((expr), 0)
|
||||
|
||||
#define TFE_LOG_ERROR(handler, fmt, ...) \
|
||||
do { MESA_handle_runtime_log(handler, RLOG_LV_FATAL, NULL, fmt, ##__VA_ARGS__); } while(0) \
|
||||
|
||||
#define TFE_LOG_INFO(handler, fmt, ...) \
|
||||
do { MESA_handle_runtime_log(handler, RLOG_LV_INFO, NULL, fmt, ##__VA_ARGS__); } while(0) \
|
||||
|
||||
#define TFE_LOG_DEBUG(handler, fmt, ...) \
|
||||
do { MESA_handle_runtime_log(handler, RLOG_LV_DEBUG, NULL, fmt, ##__VA_ARGS__); } while(0) \
|
||||
|
||||
int addr_sock_to_layer(struct sockaddr * sock_addr, int sockaddrlen, struct layer_addr * layer_addr);
|
||||
int addr_layer_to_sock(struct layer_addr * layer_addr, struct sockaddr * sock_addr);
|
||||
char* tfe_strdup(const char* s);
|
||||
|
||||
|
||||
#define TFE_LOG_ERROR
|
||||
#define TFE_LOG_INFO
|
||||
#define TFE_LOG_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user