[rancid] More ESC-codes used in HP2920 switches.

Per-Olof Olsson peo at chalmers.se
Thu Mar 28 09:03:08 UTC 2013


Hello


New HP2920-switches also use <ESC>[6n (Ansi u7, user7 code).
To prevent from use and echo esc codes add it to hpuifilter.c filter list.




[rancid at stats2 bin]$ diff -c hpuifilter.c_ORG hpuifilter.c
*** hpuifilter.c_ORG    2010-08-10 03:24:40.000000000 +0200
--- hpuifilter.c        2013-03-25 08:36:34.396596378 +0100
***************
*** 534,540 ****
  filter(char *buf, int len)
  {
      static regmatch_t pmatch[1];
! #define       N_REG           15              /* number of regexes in reg[][] */
  #define       N_CRs           2               /* number of CR replacements */
      static regex_t    preg[N_REG];
      static char               reg[N_REG][50] = {      /* vt100/220 escape codes */
--- 539,545 ----
  filter(char *buf, int len)
  {
      static regmatch_t pmatch[1];
! #define       N_REG           16              /* number of regexes in reg[][] */
  #define       N_CRs           2               /* number of CR replacements */
      static regex_t    preg[N_REG];
      static char               reg[N_REG][50] = {      /* vt100/220 escape codes */
***************
*** 553,558 ****
--- 558,564 ----
                                "\x1B\\[\\?25l",                /* vi */
                                "\x1B\\[K",                     /* ce */
                                "\x1B\\[7m",                    /* mr - ansi */
+                               "\x1B\\[6n",                    /* u7 - ansi */
                                "\x07",                         /* bell */

                                /* replace these with CR */



/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Hörsalsvägen 5                412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8660
----------------------------------------------------------


More information about the Rancid-discuss mailing list