/[radius]/radius/radlast/radlast.c
ViewVC logotype

Diff of /radius/radlast/radlast.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by gray, Mon Jul 29 14:25:16 2002 UTC revision 1.26 by gray, Wed Apr 30 08:44:33 2003 UTC
# Line 1  Line 1 
1  /* This file is part of GNU RADIUS.  /* This file is part of GNU Radius.
2     Copyright (C) 2000, Sergey Poznyakoff     Copyright (C) 2000, 2002, 2003, Sergey Poznyakoff
3    
4     This program is free software; you can redistribute it and/or modify     GNU Radius is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.     (at your option) any later version.
8    
9     This program is distributed in the hope that it will be useful,     GNU Radius is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.     GNU General Public License for more details.
13    
14     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software Foundation,     along with GNU Radius; if not, write to the Free Software Foundation,
16     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17    
 #ifndef lint  
 static char rcsid[] =  
 "$Id$";  
 #endif  
   
18  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
19  # include <config.h>  # include <config.h>
20  #endif  #endif
# Line 144  static struct argp_option options[] = { Line 139  static struct argp_option options[] = {
139  };  };
140    
141  static error_t  static error_t
142  parse_opt (key, arg, state)  parse_opt (int key, char *arg, struct argp_state *state)
         int key;  
         char *arg;  
         struct argp_state *state;  
143  {  {
144          switch (key) {          switch (key) {
145          case '0': case '1': case '2': case '3': case '4':          case '0': case '1': case '2': case '3': case '4':
# Line 227  static struct argp argp = { Line 219  static struct argp argp = {
219  };  };
220    
221  int  int
222  main(argc, argv)  main(int argc, char **argv)
         int argc;  
         char **argv;  
223  {  {
224          int index;          int index;
225    
# Line 333  rawread() Line 323  rawread()
323  volatile int stop;  volatile int stop;
324    
325  RETSIGTYPE  RETSIGTYPE
326  sig_int(sig)  sig_int(int sig)
         int sig;  
327  {  {
328          stop = 1;          stop = 1;
329  }  }
# Line 432  radwtmp() Line 421  radwtmp()
421  }  }
422    
423  int  int
424  want(ut)  want(struct radutmp *ut)
         struct radutmp *ut;  
425  {  {
426          /* First see if it's a reboot/shutdown record and handle it          /* First see if it's a reboot/shutdown record and handle it
427           * accordingly           * accordingly
# Line 478  want(ut) Line 466  want(ut)
466  }  }
467    
468  void  void
469  adduser(s)  adduser(char *s)
         char *s;  
470  {  {
471          struct user_chain *uc;          struct user_chain *uc;
472    
# Line 504  adduser(s) Line 491  adduser(s)
491   * Add WTMP entry to the head of the list   * Add WTMP entry to the head of the list
492   */   */
493  WTMP *  WTMP *
494  add_wtmp_entry(first, pp)  add_wtmp_entry(WTMP **first, WTMP *pp)
         WTMP **first;  
         WTMP *pp;  
495  {  {
496          assert(*first!=pp);          assert(*first!=pp);
497          pp->prev = NULL;          pp->prev = NULL;
# Line 522  add_wtmp_entry(first, pp) Line 507  add_wtmp_entry(first, pp)
507   * NOTE: Does not free the entry itself   * NOTE: Does not free the entry itself
508   */   */
509  WTMP *  WTMP *
510  delete_wtmp_entry(first, pp)  delete_wtmp_entry(WTMP **first, WTMP *pp)
         WTMP **first;  
         WTMP *pp;  
511  {  {
512          WTMP *p;          WTMP *p;
513    
# Line 538  delete_wtmp_entry(first, pp) Line 521  delete_wtmp_entry(first, pp)
521  }  }
522    
523  WTMP *  WTMP *
524  find_wtmp_nas(first, bp)  find_wtmp_nas(WTMP *first, struct radutmp *bp)
         WTMP *first;  
         struct radutmp *bp;  
525  {  {
526          WTMP *wp;          WTMP *wp;
527                    
# Line 552  find_wtmp_nas(first, bp) Line 533  find_wtmp_nas(first, bp)
533  }  }
534    
535  WTMP *  WTMP *
536  find_wtmp_nas_port(first, bp)  find_wtmp_nas_port(WTMP *first, struct radutmp *bp)
         WTMP *first;  
         struct radutmp *bp;  
537  {  {
538          WTMP *wp;          WTMP *wp;
539                    
# Line 567  find_wtmp_nas_port(first, bp) Line 546  find_wtmp_nas_port(first, bp)
546  }  }
547    
548  WTMP *  WTMP *
549  find_wtmp_nas_port_sid(first, bp)  find_wtmp_nas_port_sid(WTMP *first, struct radutmp *bp)
         WTMP *first;  
         struct radutmp *bp;  
550  {  {
551          WTMP *wp;          WTMP *wp;
552                    
# Line 585  find_wtmp_nas_port_sid(first, bp) Line 562  find_wtmp_nas_port_sid(first, bp)
562  /* ************************************************************************* */  /* ************************************************************************* */
563    
564  void  void
565  add_logout(bp)  add_logout(struct radutmp *bp)
         struct radutmp *bp;  
566  {  {
567          WTMP *wp;          WTMP *wp;
568    
# Line 601  add_logout(bp) Line 577  add_logout(bp)
577  }  }
578    
579  void  void
580  add_nas_restart(bp)  add_nas_restart(struct radutmp *bp)
         struct radutmp *bp;  
581  {  {
582          WTMP *wp;          WTMP *wp;
583    
# Line 617  add_nas_restart(bp) Line 592  add_nas_restart(bp)
592  }  }
593    
594  WTMP *  WTMP *
595  find_login(bp)  find_login(struct radutmp *bp)
         struct radutmp *bp;  
596  {  {
597          return find_wtmp_nas_port(login_list, bp);          return find_wtmp_nas_port(login_list, bp);
598  }  }
599    
600  WTMP *  WTMP *
601  find_logout_sid(bp)  find_logout_sid(struct radutmp *bp)
         struct radutmp *bp;  
602  {  {
603          return find_wtmp_nas_port_sid(logout_list, bp);          return find_wtmp_nas_port_sid(logout_list, bp);
604  }  }
605    
606  WTMP *  WTMP *
607  find_logout(bp)  find_logout(struct radutmp *bp)
         struct radutmp *bp;  
608  {  {
609          return find_wtmp_nas_port(logout_list, bp) ;          return find_wtmp_nas_port(logout_list, bp) ;
610  }  }
611    
612  WTMP *  WTMP *
613  find_restart(bp)  find_restart(struct radutmp *bp)
         struct radutmp *bp;  
614  {  {
615          return find_wtmp_nas(nas_updown_list, bp);          return find_wtmp_nas(nas_updown_list, bp);
616  }  }
617    
618  void  void
619  delete_logout(pp, utp)  delete_logout(WTMP *pp, struct radutmp *utp)
         WTMP *pp;  
         struct radutmp *utp;  
620  {  {
621          static int count;          static int count;
622                    
# Line 660  delete_logout(pp, utp) Line 629  delete_logout(pp, utp)
629  /* ************************************************************************* */  /* ************************************************************************* */
630    
631  char *  char *
632  proto_str(id)  proto_str(int id)
         int id;  
633  {  {
634          DICT_VALUE *dval = value_lookup(id, "Framed-Protocol");          DICT_VALUE *dval = value_lookup(id, "Framed-Protocol");
635          static char buf[64];          static char buf[64];
# Line 674  proto_str(id) Line 642  proto_str(id)
642  }  }
643    
644  char *  char *
645  port_type_str(porttype)  port_type_str(int porttype)
646  {  {
647          DICT_VALUE *dval = value_lookup(porttype, "NAS-Port-Type");          DICT_VALUE *dval = value_lookup(porttype, "NAS-Port-Type");
648          static char buf[80];          static char buf[80];
# Line 696  port_type_str(porttype) Line 664  port_type_str(porttype)
664   * LOGIN      NAS     PORT PROTO PORT_TYPE SESSION_ID  CALLER_ID FRAMED-IP       START_TIME - STOP_TIME (DURATION)   * LOGIN      NAS     PORT PROTO PORT_TYPE SESSION_ID  CALLER_ID FRAMED-IP       START_TIME - STOP_TIME (DURATION)
665   */   */
666  void  void
667  print_entry(pp, bp, mark)  print_entry(WTMP *pp, struct radutmp *bp, int mark)
         WTMP *pp;  
         struct radutmp *bp;  
         int mark;  
668  {  {
669          struct tm *tm;          struct tm *tm;
670          char ct[256];          char ct[256];
# Line 786  print_entry(pp, bp, mark) Line 751  print_entry(pp, bp, mark)
751  }  }
752    
753  void  void
754  print_reboot_entry(bp)  print_reboot_entry(struct radutmp *bp)
         struct radutmp *bp;  
755  {  {
756          char *s;          char *s;
757          struct tm *tm;          struct tm *tm;

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26