pppd拨号创建新的plugin定制自己的拨号软件

本文介绍了如何通过创建pppd插件来定制拨号行为,以适应特定需求,如处理加密密码。插件可以添加额外选项,设置hook函数以改变pppd的行为,例如在PAP认证过程中实现不同的密码处理逻辑。通过插件,用户可以更方便地使用加密过的电信密码进行拨号上网。
摘要由CSDN通过智能技术生成

The idea of plugins is to provide a way for people to customize the behaviour of pppd without having to either apply local patches to each version or get their patches accepted into the standard distribution. 

A plugin is a standard shared library object, typically with a name ending in .so.  They are loaded using the standard dlopen() library
call, so plugins are only supported on systems which support shared libraries and the dlopen call.  At present pppd is compiled with
plugin support only under Linux and Solaris.

Using gcc under Linux, a plugin called `xyz' could be compiled and linked with the following commands:

gcc -c -O xyz.c

gcc -shared -o xyz.so xyz.o

Plugins can access global variables within pppd, so it is useful for them to #include "pppd.h" from the pppd source directory.

Plugins can affect the behaviour of pppd in at least three ways:
1. They can add extra options which pppd will then recognize.  This is done by calling the add_options() procedure with a pointer to         an array of option_t structures.  The last entry in the array must have its name field set to NULL.
2. Pppd contains `hook' variables which are

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值