找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: workbaby

[pppoe] 一直在写的pppoe用户管理软件更新至0.96版

  [复制链接]
 楼主| 发表于 2012-2-3 21:28:13 | 显示全部楼层

正在写了。因为自己不会html排版,目前只把后台和功能写出来。
找到做美工的人后再美化
routeros
回复

使用道具 举报

发表于 2012-2-3 23:18:43 | 显示全部楼层
php 模拟telnet登陆实现操作的吧。
有现成代码:
  1. <?
  2. error_reporting(-1);

  3. class Telnet {
  4. var $sock = NULL;

  5. function telnet($host,$port) {
  6.   $this->sock = fsockopen($host,$port);
  7.   socket_set_timeout($this->sock,2,0);
  8. }

  9. function close() {
  10.   if ($this->sock)  fclose($this->sock);
  11.   $this->sock = NULL;
  12. }

  13. function write($buffer) {
  14.   $buffer = str_replace(chr(255),chr(255).chr(255),$buffer);
  15.   fwrite($this->sock,$buffer);
  16. }

  17. function getc() {
  18.   return fgetc($this->sock);
  19. }

  20. function read_till($what) {
  21.   $buf = '';
  22.   while (1) {
  23.    $IAC = chr(255);
  24.    
  25.    $DONT = chr(254);
  26.    $DO = chr(253);
  27.    
  28.    $WONT = chr(252);
  29.    $WILL = chr(251);
  30.    
  31.    $theNULL = chr(0);

  32.    $c = $this->getc();
  33.    
  34.    if ($c === false) return $buf;
  35.    if ($c == $theNULL) {
  36.     continue;
  37.    }

  38.    if ($c == "1") {
  39.     continue;
  40.    }

  41.    if ($c != $IAC) {
  42.     $buf .= $c;
  43.   
  44.     if ($what == (substr($buf,strlen($buf)-strlen($what)))) {
  45.      return $buf;
  46.     }
  47.     else {
  48.      continue;
  49.     }
  50.    }

  51.    $c = $this->getc();
  52.    
  53.    if ($c == $IAC) {
  54.    $buf .= $c;
  55.    }
  56.    else if (($c == $DO) || ($c == $DONT)) {
  57.     $opt = $this->getc();
  58.     // echo "we wont ".ord($opt)."\n";
  59.     fwrite($this->sock,$IAC.$WONT.$opt);
  60.    }
  61.    elseif (($c == $WILL) || ($c == $WONT)) {
  62.     $opt = $this->getc();
  63.     // echo "we dont ".ord($opt)."\n";
  64.     fwrite($this->sock,$IAC.$DONT.$opt);
  65.    }
  66.    else {
  67.     // echo "where are we? c=".ord($c)."\n";
  68.    }
  69.   }
  70. }
  71. }

  72. #/$telnet = new telnet("192.168.0.1",23);
  73. #/echo $telnet->read_till("login: ");
  74. #/$tn->write("kongxx\r\n");
  75. #/echo $telnet->read_till("password: ");
  76. #/$tn->write("KONGXX\r\n");
  77. #/echo $telnet->read_till(":> ");
  78. #/$tn->write("ls\r\n");
  79. #/echo $telnet->read_till(":> ");
  80. #/echo $telnet->close();

  81. ?>
复制代码
routeros
回复

使用道具 举报

发表于 2012-2-3 23:19:50 | 显示全部楼层
蛋散 发表于 2012-2-3 23:18
php 模拟telnet登陆实现操作的吧。
有现成代码:

可靠性不知道怎么样。
routeros
回复

使用道具 举报

发表于 2012-2-4 09:18:53 | 显示全部楼层
这个工具不错,挺实用的啊,没铜板
routeros
回复

使用道具 举报

发表于 2012-2-15 15:00:45 | 显示全部楼层
好贵,但还是下载试试。
routeros
回复

使用道具 举报

发表于 2012-2-15 22:17:08 | 显示全部楼层
很不错,支持支持
routeros
回复

使用道具 举报

发表于 2012-2-23 13:58:43 | 显示全部楼层
什么时候能够出1.0呢!!
routeros
回复

使用道具 举报

发表于 2012-4-11 12:56:41 | 显示全部楼层
支持,顶顶顶
routeros
回复

使用道具 举报

发表于 2012-4-11 13:33:27 | 显示全部楼层
不错不错使用试试
routeros
回复

使用道具 举报

发表于 2012-4-11 17:21:25 | 显示全部楼层
:):)
routeros
回复

使用道具 举报

发表于 2012-4-11 21:30:51 | 显示全部楼层
高人哪。一直在关注这个管理呢。
routeros
回复

使用道具 举报

发表于 2012-4-13 00:52:58 | 显示全部楼层
钱啊~~~就是没钱!
routeros
回复

使用道具 举报

发表于 2012-5-22 07:35:21 | 显示全部楼层
能够支持ros 5.16的版本吗
routeros
回复

使用道具 举报

发表于 2012-5-22 20:25:46 | 显示全部楼层
支持一下 顶了
routeros
回复

使用道具 举报

发表于 2012-5-23 17:13:57 | 显示全部楼层
真是一个好东西啊
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-16 04:30 , Processed in 0.088108 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表