~vibhavp/ubuntu/raring/dahdi-tools/merge-from-debian

« back to all changes in this revision

Viewing changes to dahdi_maint.c

  • Committer: Vibhav Pant
  • Date: 2012-12-26 17:23:16 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: vibhavp@gmail.com-20121226172316-o2jojsfcnr0aqrme
* Merge from Debian unstable. Remaining changes:
  - Bug Fix: If linux-headers are not installed, don't block, and print
    information for the user.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  - debian/control: Added gawk as dependency for dkms build (LP: #493304)
  - Changes from Debian:
    - debian/control: Change Maintainer
    - debian/control: Removed Uploaders field.
    - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
    - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source 

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
                                                "networkpayload|off>\n"\
57
57
                        "\t\tlocalhost - loop back towards host\n"\
58
58
                        "\t\tnetworkline - network line loopback\n"\
59
 
                        "\t\tnetworkpayload - network payload loopback\n");
 
59
                        "\t\tnetworkpayload - network payload loopback\n"\
 
60
                        "\t\tloopup - transmit loopup signal\n"\
 
61
                        "\t\tloopdown - transmit loopdown signal\n");
60
62
        fprintf(stderr, "        -i, --insert <fas|multi|crc|cas|prbs|bipolar>"\
61
63
                        "\n\t\tinsert an error of a specific type\n");
62
64
        fprintf(stderr, "        -r, --reset            "\
142
144
                        printf("Error counters not supported by the driver"\
143
145
                                        " for this span\n");
144
146
                printf("Span %d:\n", span);
145
 
                printf(">FEC : %d:\n", s.fecount);
146
 
                printf(">CEC : %d:\n", s.crc4count);
147
 
                printf(">CVC : %d:\n", s.cvcount);
148
 
                printf(">EBC : %d:\n", s.ebitcount);
149
 
                printf(">BEC : %d:\n", s.becount);
150
 
                printf(">PRBS: %d:\n", s.prbs);
151
 
                printf(">GES : %d:\n", s.errsec);
 
147
                printf(">Framing Errors : %d:\n", s.fecount);
 
148
                printf(">CRC Errors : %d:\n", s.crc4count);
 
149
                printf(">Code Violations : %d:\n", s.cvcount);
 
150
                printf(">E-bit Count : %d:\n", s.ebitcount);
 
151
                printf(">General Errored Seconds : %d:\n", s.errsec);
152
152
 
153
153
                return 0;
154
154
        }
165
165
                } else if (!strcasecmp(larg, "networkpayload")) {
166
166
                        printf("Span %d: network payload loopback ON\n", span);
167
167
                        m.command = DAHDI_MAINT_NETWORKPAYLOADLOOP;
 
168
                } else if (!strcasecmp(larg, "loopup")) {
 
169
                        printf("Span %d: transmitting loopup signal\n", span);
 
170
                        m.command = DAHDI_MAINT_LOOPUP;
 
171
                } else if (!strcasecmp(larg, "loopdown")) {
 
172
                        printf("Span %d: transmitting loopdown signal\n", span);
 
173
                        m.command = DAHDI_MAINT_LOOPDOWN;
168
174
                } else if (!strcasecmp(larg, "off")) {
169
175
                        printf("Span %d: loopback OFF\n", span);
170
176
                        m.command = DAHDI_MAINT_NONE;
173
179
                }
174
180
 
175
181
                res = ioctl(ctl, DAHDI_MAINT, &m);
176
 
                if (res)
 
182
                if (res) {
177
183
                        printf("This type of looping not supported by the"\
178
184
                                        " driver for this span\n");
 
185
                        return 1;
 
186
                }
 
187
 
 
188
                /* Leave the loopup/loopdown signal on the line for
 
189
                 * five seconds according to AT&T TR 54016
 
190
                 */
 
191
                if ((m.command == DAHDI_MAINT_LOOPUP) ||
 
192
                   (m.command == DAHDI_MAINT_LOOPDOWN)) {
 
193
                        sleep(5);
 
194
                        m.command = DAHDI_MAINT_NONE;
 
195
                        ioctl(ctl, DAHDI_MAINT, &m);
 
196
                }
179
197
        }
180
198
 
181
199
        if (iflag) {