File: Chargen.pm

package info (click to toggle)
inetsim 1.2.7%2Bdfsg.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,592 kB
  • sloc: perl: 13,006; sh: 265; ansic: 12; makefile: 10
file content (40 lines) | stat: -rw-r--r-- 779 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
# -*- perl -*-
#
# INetSim::Chargen - Base package for Chargen::TCP and Chargen::UDP
#
# RFC 864 - Character Generator Protocol
#
# (c)2007 Matthias Eckert, Thomas Hungenberg
#
# Version 0.1   (2007-03-24)
#
# For history/changelog see bottom of this file.
#
#############################################################

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;
#############################################################
#
# History:
#
# Version 0.1   (2007-03-24) th
#
#############################################################