File: Chargen.pm

package info (click to toggle)
inetsim 1.3.2%2Bdfsg.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 1,684 kB
  • sloc: perl: 13,024; sh: 262; makefile: 18; ansic: 13
file content (29 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- perl -*-
#
# INetSim::Chargen - Base package for Chargen::TCP and Chargen::UDP
#
# RFC 864 - Character Generator Protocol
#
# (c)2007-2019 Matthias Eckert, Thomas Hungenberg
#
#############################################################

package INetSim::Chargen;

use strict;
use warnings;
use base qw(INetSim::GenericServer);

sub chars{
    my $self = shift;
    my $offset = shift;
    my $chars;
    foreach (0..94){
        $chars .= chr($_ + 32);
    }
    $chars .= $chars;
    return substr($chars, $offset, 72);
}


1;