Header file reorganization and cleaning up the public API for pppd version 2.5.0... master
authorEivind Næss <eivnaes@yahoo.com>
Sat, 21 Jan 2023 06:12:58 +0000 (22:12 -0800)
committerGitHub <noreply@github.com>
Sat, 21 Jan 2023 06:12:58 +0000 (17:12 +1100)
commitba7f7e053daae846a54a1d08d3d133a5f1266ace
tree3da27cf3ca6d6eb76e3f9a05db4c5676591d5002
parent76016e1b948b7d9675b4e0750d1f943d96d9523b
Header file reorganization and cleaning up the public API for pppd version 2.5.0 (#379)

This commit does several things, being a squash-and-merge of a series
of changes; squashed in order not to break bisection.

* Clean up pppd.h, moving declarations that should only be accessed by
  pppd code (not by users of pppd) to a new pppd-private.h.  Also,
  other parts of pppd.h were moved to multilink.h, chap.h, eap.h,
  eui64.h, and a new options.h.

* Provide an API for access to data that is needed by plugins (in no
  particular order):
  - ifname
  - ifunit
  - remote_name
  - remote_number
  - peer_authname
  - status (now called "code" internally)
  - phase
  - doing_multilink
  - multilink_master
  - idle_time_limit
  - link_connect_time
  - max_connect_time
  - link_stats
  - ipparam
  - hostname
  - got_sigterm
  - got_sigusr2
  - got_sighup
  - session_number
  - maxoctets
  - maxoctets_dir
  - debug
  - persist
  - devnam
  - modem
  - peer_authname
  - sync_serial

* Update the version number to 2.5.0.

* Detect availability of stddef.h and stdarg.h.

* Rename some headers:
  - pppcrypt.c/h to crypto_ms.c/h
  - ppp-crypto.c/h to crypto.c/h
  - ppp-crypto-priv.h to crypto-priv.h
  - chap-new.c/h to chap.c/h

* Remove chap-md5.h, crypto-priv.h, eap-tls.h, etc. from the list of
  header files to be installed.

* Provide typedefs for the hook functions.

* Provide a typedef for the "phase" variable.

* Provide a typedef for the link statistics array.

* Remove the option_t typedef.

* Rename the following functions by adding a "ppp_" prefix (with the
  intention that these are a "public" API for use by plugins):
  - option_error
  - add_options
  - int_option,
  - options_from_file
  - script_setenv
  - bad_ip_adrs,
  - netif_get/set_mtu (renamed to ppp_get/set_mtu)
  - get_time
  - timeout
  - untimeout
  - safe_fork
  - sys_close
  - set_session_number
  - update_link_stats (renamed to ppp_get_link_stats)
  - add_notifier (renamed to ppp_add_notify)
  - remove_notifier (renamed to ppp_del_notify)
  - generic_[dis]establish_ppp (to ppp_generic_[dis]establish)

* Rename ppp_devnam to ppp_devname.

* Rename ppp_available() to ppp_check_kernel_support().

* Use unsigned char instead of u_char, unsigned short instead of
  u_short, uint32_t instead of u_int32_t.

* Add const to some declarations

* Update comments

* Change the interface for notifiers to use an enum to identify which
  notifier is to be modified.

* Provide an API for getting the path to a file, with an enum to
  identify different types of file.

* Link plugins with the -DPLUGIN flag

[paulus@ozlabs.org - wrote commit message]

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
86 files changed:
.github/workflows/ubuntu.yaml
configure.ac
pppd/Makefile.am
pppd/auth.c
pppd/cbcp.c
pppd/ccp.c
pppd/ccp.h
pppd/chap-md5.c
pppd/chap-new.c [deleted file]
pppd/chap-new.h [deleted file]
pppd/chap.c [new file with mode: 0644]
pppd/chap.h [new file with mode: 0644]
pppd/chap_ms.c
pppd/chap_ms.h
pppd/crypto-priv.h [new file with mode: 0644]
pppd/crypto.c [new file with mode: 0644]
pppd/crypto.h [new file with mode: 0644]
pppd/crypto_ms.c [new file with mode: 0644]
pppd/crypto_ms.h [new file with mode: 0644]
pppd/demand.c
pppd/eap-tls.c
pppd/eap.c
pppd/eap.h
pppd/ecp.c
pppd/eui64.c
pppd/eui64.h
pppd/fsm.c
pppd/fsm.h
pppd/ipcp.c
pppd/ipcp.h
pppd/ipv6cp.c
pppd/ipv6cp.h
pppd/lcp.c
pppd/lcp.h
pppd/magic.c
pppd/main.c
pppd/mppe.c
pppd/mppe.h
pppd/multilink.c
pppd/multilink.h [new file with mode: 0644]
pppd/options.c
pppd/options.h [new file with mode: 0644]
pppd/peap.c
pppd/plugins/minconn.c
pppd/plugins/passprompt.c
pppd/plugins/passwordfd.c
pppd/plugins/pppoatm/pppoatm.c
pppd/plugins/pppoe/Makefile.am
pppd/plugins/pppoe/config.h.in
pppd/plugins/pppoe/discovery.c
pppd/plugins/pppoe/if.c
pppd/plugins/pppoe/plugin.c
pppd/plugins/pppoe/pppoe-discovery.c
pppd/plugins/pppoe/pppoe.h
pppd/plugins/pppol2tp/openl2tp.c
pppd/plugins/pppol2tp/pppol2tp.c
pppd/plugins/radius/avpair.c
pppd/plugins/radius/buildreq.c
pppd/plugins/radius/clientid.c
pppd/plugins/radius/ip_util.c
pppd/plugins/radius/md5.c
pppd/plugins/radius/radattr.c
pppd/plugins/radius/radius.c
pppd/plugins/radius/radiusclient.h
pppd/plugins/radius/radrealms.c
pppd/plugins/radius/sendserver.c
pppd/plugins/winbind.c
pppd/ppp-crypto-priv.h [deleted file]
pppd/ppp-crypto.c [deleted file]
pppd/ppp-crypto.h [deleted file]
pppd/ppp-des.c
pppd/ppp-md4.c
pppd/ppp-md5.c
pppd/ppp-sha1.c
pppd/pppcrypt.c [deleted file]
pppd/pppcrypt.h [deleted file]
pppd/pppd-private.h [new file with mode: 0644]
pppd/pppd.h
pppd/session.c
pppd/sys-linux.c
pppd/sys-solaris.c
pppd/tls.c
pppd/tty.c
pppd/upap.c
pppd/upap.h
pppd/utils.c