- 博客(26)
- 资源 (3)
- 收藏
- 关注
原创 Linux简单插件框架
3. 列出所有插件时遍历plugin文件夹里的所有动态库so,先dlopen,然后dlsym查找help函数并执行。Linux插件的实现主要依赖运行时加载,程序在运行时控制加载指定的模块,并且可以在不需要该模块时将其卸载。2. 每个插件都是一个动态库so,都实现约定好的函数,例如run和help。2. dlsym:运行时加载的核心部分,可以通过这个函数找到所需要的符号。1. dlopen:用来打开一个动态库,并将其加载到进程的地址空间。3. dlclose:将一个已经加载的模块卸载。
2023-05-14 20:27:51
366
1
原创 Python SetWinEventHook
Here’s a very simple example that prints to the console the window text for each dialog that is opened:import sysimport timeimport ctypesimport ctypes.wintypesEVENT_SYSTEM_DIALOGSTART = 0x0010WINEVENT_OUTOFCONTEXT = 0x0000user32 = ctypes.windll.us
2022-02-18 08:55:26
458
原创 linux C语言根据进程名获取PID
目录Shell命令C语言(popen)Shell命令ps -e | grep 'test' | grep -v grep | awk 'print $1'ps -e : 查看所有进程grep ‘test’ : 检索包含test的进程grep -v grep : 去掉grepawk ‘print $1’ : 打印第一列内容C语言(popen)int main(){ FILE *fs=NULL; char buf[1024]; int i = 0; mems
2022-02-15 11:11:33
1283
转载 __attribute__((constructor))
The constructor attribute causes the function to be called automatically before execution enters main (). Similarly, the destructor attribute causes the function to be called automatically after main () completes or exit () is called. Functions with th...
2022-01-28 17:36:55
104
原创 pyang
Overviewpyang is a YANG validator, transformator and code generator, written in python. It can be used to validate YANG modules for correctness, to transform YANG modules into other formats, and to write plugins to generate code from the modules.YANG (
2022-01-28 17:36:40
2608
原创 libyang-Parsing YANG Modules
YANG module parsers allow to read YANG module from a specific format. libyang supports the following module formats: YANG Basic YANG schemas format described in RFC 6020 and RFC 7951 (so both YANG 1.0 and YANG 1.1 versions are supported). YIN A
2022-01-26 09:46:47
428
原创 libyang-Manipulating Data
There are many functions to create or modify an existing data tree. You can add new nodes, reconnect nodes from one tree to another (or e.g. from one list instance to another) or remove nodes. The functions doesn't allow you to put a node to a wrong place
2022-01-26 09:40:38
348
原创 libyang-Default Values
libyang provides support for work with default values as defined in RFC 6243. However, libyang context do not contains the ietf-netconf-with-defaults module on its own and caller is supposed to add this YANG module to enable full support of the with-defaul
2022-01-26 09:39:36
136
原创 libyang-Validating Data
Data validation is performed implicitly to the input data processed by the parser and on demand via the lyd_validate_*() functions. The explicit validation process is supposed to be used when a (complex or simple) change is done on the data tree (via data
2022-01-26 09:38:35
170
原创 libyang-Parsing Data
Data parser allows to read instances from a specific format. libyang supports the following data formats: XML Original data format used in NETCONF protocol. XML mapping is part of the YANG specification (RFC 6020). JSON The alternative data for
2022-01-26 09:32:28
239
原创 libyang-Data Instances
All the nodes in data tree comes are based on lyd_node structure. According to the content of the lyd_node.schema it can be cast to several other structures.In case the lyd_node.schema pointer is NULL, the node is actually opaq and can be safely cast to
2022-01-26 09:26:07
338
原创 libyang-YANG Modules
To be able to work with YANG data instances, libyang has to represent YANG data models. All the processed modules are stored in libyang context and loaded using parser functions. It means, that there is no way to create/change YANG module programmatically.
2022-01-26 09:24:07
439
原创 libyang-Context
The context concept allows callers to work in environments with different sets of YANG modules.The first step with libyang is to create a new context using ly_ctx_new(). It returns a handler used in the following work. Note that the context is supposed t
2022-01-26 09:19:23
311
原创 libyang-Data Structures
Sized ArraysThe structure starts with 32bit number storing size of the array - the number of the items inside. The size is part of the array to have it allocated together with the array itself only when it is needed. However, the pointers to the array al
2022-01-26 09:16:26
162
原创 libyang-XPath Addressing
Internally, XPath evaluation is performed on when and must conditions in the schema. For that almost a full XPath 1.0 evaluator was implemented. In YANG models you can also find paths identifying augment targets, leafref targets, and trivial paths in choic
2022-01-26 09:08:55
365
转载 centos升级svn
以下为升级的方法。默认的yum安装的版本过低。需要更新资源包文件路径操作步骤如下1、新加svn yum的仓库新建文件/etc/yum.repos.d/wandisco-svn.repo 增加如下内容[WandiscoSVN]name=Wandisco SVN Repobaseurl=http://opensource.wandisco.com/centos/$releasever/svn-1.10/RPMS/$basearch/enabled=1gpgcheck=02
2022-01-24 10:28:20
404
原创 Hotpatch
参考:应用程序热补丁(一):如何用几行代码打造应用程序热补丁 - 知乎应用程序热补丁(二):自动生成热补丁 - 知乎应用程序热补丁(三):完整的设计与实现 - 知乎kpatch-build工具和livepatch原理分析_hjkfcz的博客-CSDN博客_livepatch有啥用...
2021-12-14 17:41:48
328
转载 在centos7中设置IPV6地址
1、直接修改网卡配置文件:cd/etc/sysconfig/network-scriptsvim ifcfg-ens33IPV6INIT=yes -----网卡初始化开启IPV6IPV6_AUTOCONF=no ---IPV6地址不自动获取IPV6ADDR=2003:ac18::30a/64 -----ipv6地址IPV6_DEFAULTGW=2003:ac18/64 -----ipv6网关2、重启网络设备systemctl restart network3查看IP..
2021-11-25 11:14:55
6474
转载 组播mvr
概述: 三层的IGMP协议广泛用于IPv4网络组播。在二层网络中,IGMP协议使用资源效率低下,例如:即使少数几个接收者(receivers)连接到交换机的几个端口,交换机仍然需要将组播流量泛洪到所有端口。为了修复这种问题,人们提出了IGMP Snooping协议,但当接收者(receivers)被放置在不同VLAN的时候,IGMP Snooping却无能为力(IGMP Snooping通常只在单个VLAN中配置与生效)。组播局域网注册(MVR)功能解决接收者处于不同VLAN时的泛洪问题,它使用一个专
2021-10-26 10:27:11
852
原创 Linux多线程对同一文件读写
FREAD(3) Linux Programmer's Manual FREAD(3)NAME fread, fwrite - binary stream input/outputSYNOPSIS #include <stdio.h> size_t fread(void *ptr, size_t size, size_t nmemb, FILE *str.
2021-10-20 11:33:43
2595
原创 git常用命令
git branch --set-upstream-to=origin/common_fw git reset --hard origin/common_fw git pull后用来与远程分支同步,丢弃本地修改 git log -1 --stat 查看最近1次commit的修改文件 git log -1 -p 查看最近1次commit的详细修改 ...
2021-10-08 17:46:04
72
原创 mib browser使用
mib browser 以及 mib compiler需要用管理员打开mib浏览器中的trap-receiver 不能绑定162端口net stop snmptrap
2021-09-30 18:00:32
1044
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人