原来我一直不能将帧发完全的主要原因还是出在M_BLK_ID pMblk上,muxSend要发送的数据是都用mBlk,但其中的成员比如pClBlk尤其需要注意,不能简单的将其填充为其他的值。
要使用muxSend()来发送数据只要步骤应该是这样的:首先用muxBind来绑定你要发送的设备,这里我是这样实现的:
muxBind (“motfec”, 0, (FUNCPTR)monitorSendProcess,NULL, NULL, NULL, MUX_PROTO_SNARF, “VLAN”, NULL);
绑定后应该对NetPool进行初始化操作,应为你要发送的数据mBlk需要从你的NetPool中申请。这一步有些麻烦,我是这样实现的:
变量声明:
NET_POOL_ID pNetPool = (NET_POOL_ID)calloc(1,sizeof(NET_POOL));
M_CL_CONFIG MclBlkConfig;
CL_DESC ClDescTbl;
int ClDescTblNumEnt;
具体实现:
ClDescTbl.clNum = 4;
MclBlkConfig.mBlkNum = ClDescTbl.clNum;
MclBlkConfig.clBlkNum = ClDescTbl.clNum;

//define the M_CL_CONFIG size
MclBlkConfig.memSize = (int)(
((unsigned int)MclBlkConfig.mBlkNum * ( MSIZE + sizeof ( long ))) +
((unsigned int)MclBlkConfig.clBlkNum * ( CL_BLK_SZ + sizeof (long)))
);
//allocate the memery size of M_CL_CONFIG
MclBlkConfig.memArea = (char *)memalign(sizeof (long ),(unsigned int)MclBlkConfig.memSize);
if (MclBlkConfig.memArea == NULL)
{
free( (char *)pNetPool);
//free((char *)pMblk);
return (ERROR);
}
//defin the CL_DESC size
ClDescTbl.memSize = (ClDescTbl.clNum * ( BUFSIZE + 8 ) ) + sizeof ( int ) ;

//allocate the memery size of CL_DESC
ClDescTbl.memArea = (char *) cacheDmaMalloc ( ( unsigned int ) ClDescTbl.memSize );
if ( ( int ) ClDescTbl.memArea == NULL )
{
perror ( “Error: Memory for buffers un**ailable” );
free ( ( char * ) MclBlkConfig.memArea );
free ( ( char * ) pNetPool );
//free((char *)pMblk);
return (ERROR);
}

//initial the netpool
if ( netPoolInit ( pNetPool, &MclBlkConfig, &ClDescTbl, ClDescTblNumEnt, NULL ) == ERROR )
{
perror ( “Error: Could not init buffers” );
free ( ( char * ) MclBlkConfig.memArea );
free ( ( char * ) ClDescTbl.memArea );
free ( ( char * ) pNetPool );
//free((char *)pMblk);
return (ERROR);

}

//apply for mBlk
pMblk = netMblkGet(pNetPool, M_DONTWAIT, MT_DATA);
这样就基本完成对NetPool的初始化了,并申请了你要发送的pMblk,接下来就是对pMblk指向的数据进行填充,如此这般后,就可以用muxSend发送你要的数据了!
最后,要注意对资源的释放!
free ( ( char * ) MclBlkConfig.memArea );
free ( ( char * ) ClDescTbl.memArea );
free ( ( char * ) pNetPool );
muxSendStop(“motfec”,0);

An Open Letter to …… PH.D Class IV

it is with heavy heart that this letter is being written to this class of students. the events that transpired during the week of april 13th was substandard and not befitting a class of this caliber or level of studies.

when one student leaves during class time, without permission to pick up a fedex parcel, is met by me in the hallway and when asked whether permission was granted, the answer was……”My phone did not ring!” how did the student know that there was a parcel waiting? i believe more attention is paid to look at a cell phone than what is going on in the classroom. that indicates to me where the priorites are!

each student was notified and wared for 4 weeks that personal presentation would start and what was the result? one student was laughing through most of his presentation and others presented such a weak one that there is strong evidence that no time was spent on preparation. the proof lies with the manner of substance contained in the presentation itself and its delivery. yes, i am aware of the pressure placed on you for maintaining a high academic standard in your studies in program of your major. however, this does not invite you to be slack concerning this perquisite course of oral english. you require a specific mark in order to pass and obtain your degree from this course. i would conclude from your actions that you would be high school students rather than PH.D. students solely based on events for the past two weeks.

coming from canada to teach in this school was priviledge and anhonor especially being recommended by previous teachers, i deem it that each student is not satisfied with the curriculum of this class and its teacher, hence these events and troubled classroom atmosphere. thus i am willing to remove myself and norify the english department accordingly and you may continue your studies in oral english by yourself and user whatever means to improve your level and competency.

on the other hand, of the students of this class are willing to do their homework, do their presentation in a orderly manner which indicates that serious effort has taken place, i am more than willing to continue in this class with the format laid out in the syllabus. every effort will be extended by me to correct, instruct and introduce new vocabulary, and pronunciation in an oral setting. the choice rests with each student in this class. when you are serious… email me at [email protected] and i will return to this class. your time as well as mine is valuable and it is too precious to waste… …thank you!

问题:PC A,PC B,8541 C,8541,D

A和C以及B和D分别连接为局域网,C和D之间是空中借口,现在要在A-B之间进行网络通信(例如ftp)。之前用HOOK抓包再送到以太网卡上遇到的问题是因为A B的网络配置把彼此的IP地址配置到了同一个子网里面,因此会有arp查询包,需要在8541上做arp欺骗。只要把它们的网络设置为不同的网段,例如

A:192.168.0.1/255.255.255.0

B:192.168.1.1/255.255.255.0

C:192.168.0.2/255.255.255.0

D:192.168.1.2/255.255.255.0

并把C与D设置为网关,这样一来由A发往B的IP包会发到网关C上,在C上做Hook抓到,通过空中借口原样发到D上,D以网关的身份发给B。不需要做中继欺骗,相当于我们用空中借口实现了一个隧道。而且这样一来可以在一个片子上接多个MT,只要IP地址不冲突。

由此推想,通过VPN接入专有网络的机器的IP地址应该是不同于真实专有网络的IP网段,否则路有肯定会出错。

::: 金币换***活动如期结束,可参加“新***活动”或“包月***” :::
2006-3-30
尊敬的POPO用户:

      按照去年4月公告(详情),开展了两年的“POPO金币换***活动”在3月31日如期结束。为了让绝大部分用户知晓并了解新的***服务,特别留出一周的公告时间,所以活动正式结束时间:2006年4月7日。(详情)

活动结束后,为继续满足广大用户使用POPO方便快捷发送***的需求,我们进行了三方面的改进。

      一、提高***服务质量
对于免费***和包月***POPO都将提供***发送报告,以告知用户***发送是否成功,如果***发送失败则不会扣取金币,也不会记入发出的***条数中。

      二、提供多种服务/活动供用户选择

      (1)仅绑定手机,不参与任何活动或服务

      (2)参与“看广告,发送免费***”活动测试

      (3)1元包月***:可以发送无限条数的***(当月***差额不能超过11条)

      (4)3元包月***:可以发送无限条数的***(当月***差额不能超过35条)

      (5)6元包月***:可以发送无限条数的***(当月***差额不能超过75条)

***差额指发出的***数量减去接收到的***数量。差额到达限制条件时无法继续发送,须在POPO上收到新的***后才可以继续发送(提示)。

对于2006年3月31日以前参与“POPO金币换***”活动的老用户,可以选择服务(1)-(5)五种服务中的一种,2006年3月31日以后注册手机的用户只能选择除(2)之外的其他服务形式 (提示:如何定制包月***服务?)。

      原6元包月用户若未注销服务或选择其他包月方式则会默认转为新的6元包月服务(不会额外收费)。考虑这种过渡关系,6元包月服务在4月份仍是限制发送条数而不限***差额,5月份起启用新规则。

      三、改变***服务内容,不限制***发送总条数
将限制每月***发送条数改变为限制***差额。
***差额限制是针对非正常使用***的用户。对于正常使用POPO***的用户来说,因为在一个月里面总会是“有收有发”基本平衡,所以不会受***差额的影响,而且现在每月还可以发送无限条数的***了。

相关链接:
网易 POPO 官方网站:   http://popo.163.com
网易 POPO 用户反馈:   http://popo.163.com/report/
网易 POPO 客户端下载:  http://popo.163.com/download.shtml
网易 POPO 表情形象下载: http://popo.163.com/i/
网易 POPO 帮助:       http://popo.163.com/help/

网易POPO
2006年3月30日

******************************************************************************************************

正式放弃popo,呵呵