Packages sent and received by the fakewap program
This file documents the packages sent and received by the fakewap
program. Fakewap tests a WAP gateway by sending UDP packages
to make simple requests for WML pages. It is meant for stress
testing the gateway.
The basic session looks like this (WTP is the transaction and
WSP is the session protocol layer):
A) Fakewap -> Gateway
WTP: Invoke PDU
WSP: Connect PDU
B) Gateway -> Fakewap
WTP: Result PDU
WSP: ConnectReply PDU
C) Fakewap -> Gateway
WTP: Ack PDU
D) Fakewap -> Gateway
WTP: Invoke PDU
WSP: Get PDU
E) Gateway -> Fakewap
WTP: Result PDU
WSP: Reply PDU
F) Fakewap -> Gateway
WTP: Ack PDU
G) Fakewap -> Gateway
WTP: Invoke PDU
WSP: Disconnect PDU
Packets A-C open a WAP session. Packets D-F fetch a WML page.
Packet G closes the session.
The fakewap program does not need to understand the WAP protocols
as such, it just needs to generate packets in the right order
with a little variation, and keep track of which packets have
received and which have not received responses.
The detailed formats of the packets are listed below. Note
that bits are numbered in the WAP specification with the
most significant bit being 0, not 7. Unspecified bits are
filled in fakewap or the gateway.
Packet A)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 0 | | | | | | | | \ TID, fakewap
------------+---+---+---+---+---+---+---+---| |-- generates
octet 3 | | | | | | | | | / linearly
------------+---+---+---+---+---+---+---+---|
octet 4 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
------------+---+---+---+---+---+---+---+---|
octet 6 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
Fakewap generates a new TID (transaction ID) for each A) packet
is generates. TIDs are generated linearly. If a 15 bit counter
overflows, fakewap can, for now, stop sending anything.
Packet B)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 1 | | | | | | | | \ TID, gateway
------------+---+---+---+---+---+---+---+---| | copies from
octet 3 | | | | | | | | | / A) packet
------------+---+---+---+---+---+---+---+---|
octet 4 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 5 | | | | | | | | | \
------------+---+---+---+---+---+---+---+---| | Session ID,
... | | | | | | | | | | generated by
------------+---+---+---+---+---+---+---+---| | gateway
octet n | | | | | | | | | /
------------+---+---+---+---+---+---+---+---|
octet n+1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet n+2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
Fakewap needs to extract the TID and match it to the list of
A) packets it has sent that have not yet received a B) packet
in response. It also needs to extract and store the Session
ID because that is needed by G).
The Session ID is encoded in the uintvar format specified by
the WSP specification, section 8.1.2 in the WAP 1.1 version.
Code for decoding it is in gw/wsp.c (should be moved elsewhere).
Packet C) and F)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 0 | | | | | | | | \ TID, must be
------------+---+---+---+---+---+---+---+---| | same as in
octet 3 | | | | | | | | | / A) or D) packet.
------------+---+---+---+---+---+---+---+---|
Packets C) and F) are identical, except C) gets its TID from
an A) packet, and F) from a D) packet.
Packet D)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 0 | | | | | | | | \ TID, fakewap
------------+---+---+---+---+---+---+---+---| | generates a
octet 3 | | | | | | | | | / new one
------------+---+---+---+---+---+---+---+---|
octet 4 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 6 | | | | | | | | | \
------------+---+---+---+---+---+---+---+---| |
... | | | | | | | | | | URI length
------------+---+---+---+---+---+---+---+---| |
octet n | | | | | | | | | /
------------+---+---+---+---+---+---+---+---|
octet n+1 | | | | | | | | | \
------------+---+---+---+---+---+---+---+---| |
... | | | | | | | | | | URI
------------+---+---+---+---+---+---+---+---| |
octet n+m | | | | | | | | | /
------------+---+---+---+---+---+---+---+---|
The URI (or URL) length is specified with uintvar (code to
generate them also in gw/wsp.c). The URL itself is just the
octets of the string copied as is.
Packet E)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 1 | | | | | | | | \ TID, gateway
------------+---+---+---+---+---+---+---+---| | copies from
octet 3 | | | | | | | | | / D) packet
------------+---+---+---+---+---+---+---+---|
octet 4 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 5 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
------------+---+---+---+---+---+---+---+---|
octet 7 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 8 | | | | | | | | | \
------------+---+---+---+---+---+---+---+---| | Compiled WML
... | | | | | | | | | | page.
------------+---+---+---+---+---+---+---+---| |
octet n | | | | | | | | | /
------------+---+---+---+---+---+---+---+---|
Fakewap needs to extract the TID so it can match it to the
D) packet it sent. It can ignore the WML page for now.
Packet G)
bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------+---+---+---+---+---+---+---+---|
octet 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 2 | 0 | | | | | | | | \ TID, fakewap
------------+---+---+---+---+---+---+---+---| | generates a
octet 3 | | | | | | | | | / new one
------------+---+---+---+---+---+---+---+---|
octet 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------------+---+---+---+---+---+---+---+---|
octet 5 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
------------+---+---+---+---+---+---+---+---|
octet 6 | | | | | | | | | \
------------+---+---+---+---+---+---+---+---| | Session ID,
... | | | | | | | | | | copied from
------------+---+---+---+---+---+---+---+---| | B) packet.
octet n | | | | | | | | | /
------------+---+---+---+---+---+---+---+---|
没有合适的资源?快使用搜索试试~ 我知道了~
mmsclient-alpha-0.1.tar
需积分: 9 18 下载量 76 浏览量
2008-10-07
15:07:14
上传
评论
收藏 10.08MB GZ 举报
温馨提示
共1127个文件
c:243个
h:236个
o:106个
mms 源代码,在linux平台下使用,特别适合在嵌入式系统中使用
资源推荐
资源详情
资源评论
收起资源包目录
mmsclient-alpha-0.1.tar (1127个子文件)
ChangeLog-1.2.0 29KB
ChangeLog-1.2.0 29KB
ChangeLog-1.3.0 12KB
ChangeLog-1.3.0 12KB
ChangeLog-0.13.1 282KB
ChangeLog-0.13.1 282KB
ChangeLog-1.2.1 25KB
ChangeLog-1.2.1 25KB
ChangeLog-1.1 24KB
ChangeLog-1.1 24KB
ChangeLog-1.3.1 11KB
ChangeLog-1.3.1 11KB
ChangeLog-1.1.1 10KB
ChangeLog-1.1.1 10KB
seewbmp.1 465B
seewbmp.1 465B
wmlsdasm.1 408B
wmlsc.1 392B
ChangeLog-1.1.2 10KB
ChangeLog-1.1.2 10KB
ChangeLog-1.1.3 10KB
ChangeLog-1.1.3 10KB
ChangeLog-1.1.4 20KB
ChangeLog-1.1.4 20KB
ChangeLog-1.1.5 5KB
ChangeLog-1.1.5 5KB
ChangeLog-1.1.6 82KB
ChangeLog-1.1.6 82KB
start-stop-daemon.8 4KB
start-stop-daemon.8 4KB
kannel.8 1KB
kannel.8 1KB
kannel.8 1KB
kannel.8 1KB
run_kannel_box.8 860B
run_kannel_box.8 860B
libgw.a 1.4MB
libwap.a 1.2MB
libgwlib.a 1.12MB
libwmlscript.a 770KB
libmms.a 68KB
AUTHORS 137B
AUTHORS 81B
wap-appl.c.backup 42KB
wap-appl.c.backup 42KB
wap-appl.c.backup 42KB
wap-appl.c.backup 42KB
wap-appl.h.backup 700B
wap-appl.h.backup 700B
wap-appl.h.backup 700B
wap-appl.h.backup 700B
bearerbox 2.74MB
bearerbox 2.74MB
build-cygwin-package 897B
build-cygwin-package 897B
wsp_headers.c 83KB
wsp_headers.c 83KB
smsc_at2.c 82KB
smsc_at2.c 82KB
smsc_at2.c 82KB
smsc_at2.c 82KB
http.c 74KB
http.c 74KB
wsgram.c 64KB
smsbox.c 58KB
smsbox.c 58KB
smsbox.c 58KB
smsbox.c 58KB
octstr.c 49KB
octstr.c 49KB
mms-appl.c 46KB
mms-appl.c 46KB
mms-appl.c 46KB
mms-appl.c 46KB
wml_compiler.c 44KB
wml_compiler.c 44KB
wml_compiler.c 44KB
wml_compiler.c 44KB
wsstree.c 43KB
conn.c 41KB
conn.c 41KB
wtls_pdu.c 40KB
wtls_pdu.c 40KB
wtls_pdusupport.c 34KB
wtls_pdusupport.c 34KB
wslexer.c 33KB
wsp_client_session.c 33KB
wsp_client_session.c 33KB
xmlrpc.c 32KB
xmlrpc.c 32KB
wsbc.c 31KB
urltrans.c 31KB
urltrans.c 31KB
urltrans.c 31KB
urltrans.c 31KB
dlr.c 30KB
dlr.c 30KB
dlr.c 30KB
dlr.c 30KB
wtls_statesupport.c 29KB
共 1127 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
jianqiliu999
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功