Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
598 B

  1. #!./perl
  2. $pat = 'S n C4 x8';
  3. $inet = 2;
  4. $echo = 7;
  5. $smtp = 25;
  6. $nntp = 119;
  7. $this = pack($pat,$inet,2345, 0,0,0,0);
  8. select(NS); $| = 1; select(stdout);
  9. if (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; }
  10. if (bind(S,$this)) { print "bind ok\n"; } else { die $!; }
  11. if (listen(S,5)) { print "listen ok\n"; } else { die $!; }
  12. for (;;) {
  13. print "Listening again\n";
  14. if ($addr = accept(NS,S)) { print "accept ok\n"; } else { die $!; }
  15. @ary = unpack($pat,$addr);
  16. $, = ' ';
  17. print @ary; print "\n";
  18. while (<NS>) {
  19. print;
  20. print NS;
  21. }
  22. }