⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
💻
字号:
A SAMPLE LLRPC USER===================    There are two ways to communicate with a Click kernel module from userlevel. The first, handlers, uses a simple file-based model: you read andwrite files in /click or /click/ELEMENTNAME. Generally, these files areASCII. For example, to read the current count from a counter named 'c', youmight read '/click/c/count', then parse the result (a simple string like"2003") into an integer. To change the RED min_thresh parameter, you mightwrite a string like "10" to the file '/click/red/min_thresh'.    Handlers are a heavyweight mechanism -- all that file opening andclosing and data parsing and unparsing -- although relatively easy to use.The other communication method, LLRPCs (low-level remote procedure calls),is much faster, although less safe; it's suitable for heavy-dutykernel/user communication.    A Click LLRPC is implemented by ioctl. A user-level program opens anyof the element's handler files -- for example, its '/click/ELEMENT/name'handler -- then calls ioctl(), passing in the file descriptor, one of theLLRPC IDs from <click/llrpc.h>, and the relevant data. For example, theCLICK_LLRPC_GET_COUNT LLRPC takes a pointer to an integer. On input, thisinteger identifies the counter of interest.  On output, its value is set tothe relevant count. This is much less expensive than using an ASCII 'count'handler.    Several of our elements provide LLRPC interfaces; for example, checkout the Counter element in elements/standard/counter.cc. These interfacesare generally documented in the element manual pages -- for example, 'manCounter'.    Sometimes, you may want to keep a file descriptor open for a long timefor making LLRPC calls. Remember that this file descriptor will becomeinvalid if someone installs another Click configuration! All LLRPC calls onthe old file descriptor will return EINVAL. One reasonable behavior forEINVAL errors is to close and reopen the file descriptor on error, tryagain, and only complain if the ioctl fails the second time as well.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -