patch-pppd_lcp_c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --- ppp-2.4.6.orig/pppd/lcp.c 2014-01-02 05:42:08.000000000 +0100
  2. +++ ppp-2.4.6/pppd/lcp.c 2014-06-05 21:05:49.000000000 +0200
  3. @@ -52,6 +52,7 @@
  4. #include "pppd.h"
  5. #include "fsm.h"
  6. +#include "eap.h"
  7. #include "lcp.h"
  8. #include "chap-new.h"
  9. #include "magic.h"
  10. @@ -66,7 +67,7 @@ static const char rcsid[] = RCSID;
  11. /* steal a bit in fsm flags word */
  12. #define DELAYED_UP 0x100
  13. -static void lcp_delayed_up __P((void *));
  14. +static void lcp_delayed_up (void *);
  15. /*
  16. * LCP-related command-line options.
  17. @@ -76,12 +77,12 @@ int lcp_echo_fails = 0; /* Tolerance to
  18. bool lax_recv = 0; /* accept control chars in asyncmap */
  19. bool noendpoint = 0; /* don't send/accept endpoint discriminator */
  20. -static int noopt __P((char **));
  21. +static int noopt (char **);
  22. #ifdef HAVE_MULTILINK
  23. -static int setendpoint __P((char **));
  24. -static void printendpoint __P((option_t *, void (*)(void *, char *, ...),
  25. - void *));
  26. +static int setendpoint (char **);
  27. +static void printendpoint (option_t *, void (*)(void *, char *, ...),
  28. + void *);
  29. #endif /* HAVE_MULTILINK */
  30. static option_t lcp_option_list[] = {
  31. @@ -202,31 +203,31 @@ static u_char nak_buffer[PPP_MRU]; /* wh
  32. /*
  33. * Callbacks for fsm code. (CI = Configuration Information)
  34. */
  35. -static void lcp_resetci __P((fsm *)); /* Reset our CI */
  36. -static int lcp_cilen __P((fsm *)); /* Return length of our CI */
  37. -static void lcp_addci __P((fsm *, u_char *, int *)); /* Add our CI to pkt */
  38. -static int lcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */
  39. -static int lcp_nakci __P((fsm *, u_char *, int, int)); /* Peer nak'd our CI */
  40. -static int lcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */
  41. -static int lcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv peer CI */
  42. -static void lcp_up __P((fsm *)); /* We're UP */
  43. -static void lcp_down __P((fsm *)); /* We're DOWN */
  44. -static void lcp_starting __P((fsm *)); /* We need lower layer up */
  45. -static void lcp_finished __P((fsm *)); /* We need lower layer down */
  46. -static int lcp_extcode __P((fsm *, int, int, u_char *, int));
  47. -static void lcp_rprotrej __P((fsm *, u_char *, int));
  48. +static void lcp_resetci (fsm *); /* Reset our CI */
  49. +static int lcp_cilen (fsm *); /* Return length of our CI */
  50. +static void lcp_addci (fsm *, u_char *, int *); /* Add our CI to pkt */
  51. +static int lcp_ackci (fsm *, u_char *, int); /* Peer ack'd our CI */
  52. +static int lcp_nakci (fsm *, u_char *, int, int); /* Peer nak'd our CI */
  53. +static int lcp_rejci (fsm *, u_char *, int); /* Peer rej'd our CI */
  54. +static int lcp_reqci (fsm *, u_char *, int *, int); /* Rcv peer CI */
  55. +static void lcp_up (fsm *); /* We're UP */
  56. +static void lcp_down (fsm *); /* We're DOWN */
  57. +static void lcp_starting (fsm *); /* We need lower layer up */
  58. +static void lcp_finished (fsm *); /* We need lower layer down */
  59. +static int lcp_extcode (fsm *, int, int, u_char *, int);
  60. +static void lcp_rprotrej (fsm *, u_char *, int);
  61. /*
  62. * routines to send LCP echos to peer
  63. */
  64. -static void lcp_echo_lowerup __P((int));
  65. -static void lcp_echo_lowerdown __P((int));
  66. -static void LcpEchoTimeout __P((void *));
  67. -static void lcp_received_echo_reply __P((fsm *, int, u_char *, int));
  68. -static void LcpSendEchoRequest __P((fsm *));
  69. -static void LcpLinkFailure __P((fsm *));
  70. -static void LcpEchoCheck __P((fsm *));
  71. +static void lcp_echo_lowerup (int);
  72. +static void lcp_echo_lowerdown (int);
  73. +static void LcpEchoTimeout (void *);
  74. +static void lcp_received_echo_reply (fsm *, int, u_char *, int);
  75. +static void LcpSendEchoRequest (fsm *);
  76. +static void LcpLinkFailure (fsm *);
  77. +static void LcpEchoCheck (fsm *);
  78. static fsm_callbacks lcp_callbacks = { /* LCP callback routines */
  79. lcp_resetci, /* Reset our Configuration Information */
  80. @@ -251,11 +252,11 @@ static fsm_callbacks lcp_callbacks = { /
  81. * Some of these are called directly.
  82. */
  83. -static void lcp_init __P((int));
  84. -static void lcp_input __P((int, u_char *, int));
  85. -static void lcp_protrej __P((int));
  86. -static int lcp_printpkt __P((u_char *, int,
  87. - void (*) __P((void *, char *, ...)), void *));
  88. +static void lcp_init (int);
  89. +static void lcp_input (int, u_char *, int);
  90. +static void lcp_protrej (int);
  91. +static int lcp_printpkt (u_char *, int,
  92. + void (*) __P((void *, char *, ...)), void *);
  93. struct protent lcp_protent = {
  94. PPP_LCP,
  95. @@ -322,7 +323,7 @@ setendpoint(argv)
  96. static void
  97. printendpoint(opt, printer, arg)
  98. option_t *opt;
  99. - void (*printer) __P((void *, char *, ...));
  100. + void (*printer) (void *, char *, ...);
  101. void *arg;
  102. {
  103. printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint));
  104. @@ -1995,7 +1996,7 @@ static int
  105. lcp_printpkt(p, plen, printer, arg)
  106. u_char *p;
  107. int plen;
  108. - void (*printer) __P((void *, char *, ...));
  109. + void (*printer) (void *, char *, ...);
  110. void *arg;
  111. {
  112. int code, id, len, olen, i;