├── .gitignore
├── Documents.html
├── Install.html
├── License
├── gpl-3.0-standalone.html
└── gpl-3.0.txt
├── Makefile.am
├── Makefile_OpenWrt
├── README.md
├── ReadMe.html
├── configure.ac
├── help
├── src-gui
├── gtkgui
│ ├── AUTHORS
│ ├── COPYING
│ ├── ChangeLog
│ ├── HACKING
│ ├── Makefile.am
│ ├── NEWS
│ ├── README
│ ├── config.c
│ ├── configure.ac
│ ├── hello.c
│ ├── hello.h
│ ├── m4
│ │ └── .gitignore
│ ├── po
│ │ ├── Makefile.in.in
│ │ ├── POTFILES.in
│ │ └── zh_CN.po
│ └── tests
│ │ └── Makefile.am
├── luci
│ ├── luci_controller_njit.lua
│ ├── njit.lua
│ └── readme
└── qt4gui
│ ├── ReadMe.html
│ ├── dialogs
│ ├── mainDlg.cpp
│ └── mainDlg.h
│ ├── main.cpp
│ ├── main.h
│ └── qt4gui.pro
└── src
├── Makefile.am
├── RefreshIP
├── auth.c
├── configure.ac
├── debug.h
├── decrypt.c
├── fillmd5-libcrypto.c
├── m4
├── README
└── tcpdump-aclocal.m4
├── main.c
├── md5-buildin
├── md5_dgst.c
├── md5_one.c
├── md5test.c
└── mem_clr.c
├── njit8021xclient.c
└── njit8021xclient.h
/.gitignore:
--------------------------------------------------------------------------------
1 | *aclocal.m4
2 | *autom4te.cache
3 | *configure
4 | *compile
5 | *Makefile
6 | *Makefile.in
7 | *config.log
8 | *config.h*
9 | *config.status
10 | *install-sh
11 | *missing
12 | *.tar.gz
13 | *.deps/
14 | *depcomp
15 | *.o
16 | *.dirstamp
17 | *stamp-h1
18 | *.swp
19 | src/client
20 | src/conv/
21 |
--------------------------------------------------------------------------------
/Documents.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | NJIT 802.1X Client -- Documents
4 |
5 |
6 |
7 | ===============================================================================
8 | 南京工程学院 - 校园网802.1X客户端 - 项目文档
9 | -------------------------------------------------------------------------------
10 | 参考AGanNo2的相关介绍,在此将版本号加密/解密步骤整理如下。
11 |
12 | [H3C版本号加密流程]
13 |
14 | 选取任意32位随机数,并生成字符串形式的密钥
15 | uint32_t randam;
16 | char key[8+1];
17 | sprintf(key, "%08x", randam);
18 |
19 |
20 | 加密步骤:
21 | char version[16]="EN V2.40-0335";
22 | |
23 | | 异或
24 | |《———————— key[] (例如取randam=0x12345678,则字符串key[]为"12345678")
25 | |
26 | version[16]: "LK%W3+19$5624 "
27 | |
28 | | 将整数randam附加到version[16]之后,组成20字节
29 | |《—————————————————————————————————————————————
30 | |
31 | version[20]: "LK%W3+19$5624 4Vx"
32 | |
33 | | 异或
34 | |《——————— "HuaWei3COM1X"
35 | |
36 | version[20]: "; <s23IJ%?C "
37 | |
38 | | 按照Base64格式编码,输出可读的ASCII字符串
39 | |《——————————————————————————————————————————
40 | |
41 | 最后生成的28字节版本号为:
42 | Rw0tZQEjdzIzSUolP0MNOyA8EHM=
43 |
44 |
45 |
46 |
47 | [“异或”运算的细节]
48 | 1、每个密钥被按正序、逆序使用两遍
49 | 2、密钥会被扩展为与待加密数据长度相同
50 |
51 | 使用密钥key[]="12345678"加密"EN V2.40-0335":
52 |
53 | "EN V2.40-0335 "
54 | "1234567812345678"
55 | XOR "8765432187654321"
56 | ————————————————————————————————
57 | "LK%W3+19$5624 "
58 |
59 |
60 |
61 | 使用密钥"HuaWei3COM1X"加密"LK%W3+19$5624 4Vx":
62 |
63 | "LK%W3+19$5624 4Vx"
64 | "HuaWei3COM1XHuaWei3C"
65 | XOR "C3ieWauHX1MOC3ieWauH"
66 | ————————————————————————————————
67 | "; <s23IJ%?C "
68 |
69 |
70 |
71 |
72 | [H3C认证服务器解读版本号流程]
73 |
74 | 28字节版本号秘文
75 | |
76 | | Base64解码
77 | |《—————————————
78 | |
79 | verison[20]
80 | |
81 | | 异或
82 | |《———————— "HuaWei3COM1X"
83 | |
84 | version[20]
85 | | \
86 | | \
87 | 前16字节 取出末尾4字节,即randam
88 | | |
89 | | |
90 | | |
91 | | 异或 |
92 | |《—————— key[]
93 | |
94 | |
95 | 还原成版本号字符串"EN V2.40-0335"
96 |
97 | ===============================================================================
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/Install.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | NJIT 802.1X Client -- INSTALL
4 |
5 |
6 | ===============================================================================
7 | 南京工程学院 - 校园网802.1X客户端 - 编译及安装
8 | -------------------------------------------------------------------------------
9 |
10 | [从源代码编译]
11 | 为方便大家研究讨论,我们已将客户端源代码随编译好的可执行文件一同发布。
12 | 进行编译之前需安装的几个开发包如下:
13 | 对应Ubuntu/Debian的是:
14 | sudo apt-get install libpcap-dev libssl-dev
15 | sudo apt-get install pkg-config
16 | 对应Fedora/Redhat的是:
17 | yum install libpcap-devel openssl-devel
18 | yum install pkgconfig
19 |
20 | 从源码包开始编译客户端的命令为:
21 | tar xzf njit8021xlient-1.1.tar.gz
22 | cd njit8021xlient-1.1
23 | ./configure
24 | make
25 | 安装:
26 | make install
27 | 注1:默认安装至/usr/local目录,需要root管理员权限
28 | 注2:可以通过设置DESTDIR将编译好的文件输出至临时文件夹,然后压缩打包
29 | make install DESTDIR="/tmp/临时文件夹"
30 | ...
31 | cd /tmp/临时文件夹/
32 | tar czf njit8021xlient-1.1-i386.tar.gz .
33 |
34 | 如果您在使用或编译过程中遇到困难,可以在发送Email至开发小组的公共信箱
35 | njit8021xclient@googlegroups.com
36 | 或加QQ群86079951
37 |
38 | [软件维护]
39 | 1、校园网802.1X客户端Wiki文档:
40 | 位于Ubuntu中文社区的Wiki词条为:
41 | http://wiki.ubuntu.org.cn/南京工程学院802.1X客户端
42 | http://wiki.ubuntu.org.cn/802.1X
43 | (只要你有Ubuntu社区帐号,登录后即可编辑所有Wiki词条)
44 |
45 | 2、校园网802.1X客户端开发小组邮件列表:
46 | 只需发邮件至njit8021xclient@googlegroups.com即可加入!
47 |
48 | 3、校园网802.1X客户端交流QQ群(感谢jack235)
49 | 群号:86079951
50 |
51 | 4、使用Git进行源代码版本管理,通过git命令下载源代码:
52 | git clone git://github.com/liuqun/njit8021xclient.git
53 | 注:从GitHub下载的代码第一次编译时必须先执行以下命令以生成configure脚本
54 | autoreconf --install
55 |
56 | 5、通过Internet浏览器在线查看最新源代码:
57 | http://github.com/liuqun/njit8021xclient
58 | ===============================================================================
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/License/gpl-3.0-standalone.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | GNU General Public License - GNU Project - Free Software Foundation (FSF)
7 |
8 | GNU GENERAL PUBLIC LICENSE
9 | Version 3, 29 June 2007
10 |
11 | Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
12 | Everyone is permitted to copy and distribute verbatim copies
13 | of this license document, but changing it is not allowed.
14 |
15 | Preamble
16 |
17 | The GNU General Public License is a free, copyleft license for
18 | software and other kinds of works.
19 |
20 | The licenses for most software and other practical works are designed
21 | to take away your freedom to share and change the works. By contrast,
22 | the GNU General Public License is intended to guarantee your freedom to
23 | share and change all versions of a program--to make sure it remains free
24 | software for all its users. We, the Free Software Foundation, use the
25 | GNU General Public License for most of our software; it applies also to
26 | any other work released this way by its authors. You can apply it to
27 | your programs, too.
28 |
29 | When we speak of free software, we are referring to freedom, not
30 | price. Our General Public Licenses are designed to make sure that you
31 | have the freedom to distribute copies of free software (and charge for
32 | them if you wish), that you receive source code or can get it if you
33 | want it, that you can change the software or use pieces of it in new
34 | free programs, and that you know you can do these things.
35 |
36 | To protect your rights, we need to prevent others from denying you
37 | these rights or asking you to surrender the rights. Therefore, you have
38 | certain responsibilities if you distribute copies of the software, or if
39 | you modify it: responsibilities to respect the freedom of others.
40 |
41 | For example, if you distribute copies of such a program, whether
42 | gratis or for a fee, you must pass on to the recipients the same
43 | freedoms that you received. You must make sure that they, too, receive
44 | or can get the source code. And you must show them these terms so they
45 | know their rights.
46 |
47 | Developers that use the GNU GPL protect your rights with two steps:
48 | (1) assert copyright on the software, and (2) offer you this License
49 | giving you legal permission to copy, distribute and/or modify it.
50 |
51 | For the developers' and authors' protection, the GPL clearly explains
52 | that there is no warranty for this free software. For both users' and
53 | authors' sake, the GPL requires that modified versions be marked as
54 | changed, so that their problems will not be attributed erroneously to
55 | authors of previous versions.
56 |
57 | Some devices are designed to deny users access to install or run
58 | modified versions of the software inside them, although the manufacturer
59 | can do so. This is fundamentally incompatible with the aim of
60 | protecting users' freedom to change the software. The systematic
61 | pattern of such abuse occurs in the area of products for individuals to
62 | use, which is precisely where it is most unacceptable. Therefore, we
63 | have designed this version of the GPL to prohibit the practice for those
64 | products. If such problems arise substantially in other domains, we
65 | stand ready to extend this provision to those domains in future versions
66 | of the GPL, as needed to protect the freedom of users.
67 |
68 | Finally, every program is threatened constantly by software patents.
69 | States should not allow patents to restrict development and use of
70 | software on general-purpose computers, but in those that do, we wish to
71 | avoid the special danger that patents applied to a free program could
72 | make it effectively proprietary. To prevent this, the GPL assures that
73 | patents cannot be used to render the program non-free.
74 |
75 | The precise terms and conditions for copying, distribution and
76 | modification follow.
77 |
78 | TERMS AND CONDITIONS
79 |
80 | 0. Definitions.
81 |
82 | “This License” refers to version 3 of the GNU General Public License.
83 |
84 | “Copyright” also means copyright-like laws that apply to other kinds of
85 | works, such as semiconductor masks.
86 |
87 | “The Program” refers to any copyrightable work licensed under this
88 | License. Each licensee is addressed as “you”. “Licensees” and
89 | “recipients” may be individuals or organizations.
90 |
91 | To “modify” a work means to copy from or adapt all or part of the work
92 | in a fashion requiring copyright permission, other than the making of an
93 | exact copy. The resulting work is called a “modified version” of the
94 | earlier work or a work “based on” the earlier work.
95 |
96 | A “covered work” means either the unmodified Program or a work based
97 | on the Program.
98 |
99 | To “propagate” a work means to do anything with it that, without
100 | permission, would make you directly or secondarily liable for
101 | infringement under applicable copyright law, except executing it on a
102 | computer or modifying a private copy. Propagation includes copying,
103 | distribution (with or without modification), making available to the
104 | public, and in some countries other activities as well.
105 |
106 | To “convey” a work means any kind of propagation that enables other
107 | parties to make or receive copies. Mere interaction with a user through
108 | a computer network, with no transfer of a copy, is not conveying.
109 |
110 | An interactive user interface displays “Appropriate Legal Notices”
111 | to the extent that it includes a convenient and prominently visible
112 | feature that (1) displays an appropriate copyright notice, and (2)
113 | tells the user that there is no warranty for the work (except to the
114 | extent that warranties are provided), that licensees may convey the
115 | work under this License, and how to view a copy of this License. If
116 | the interface presents a list of user commands or options, such as a
117 | menu, a prominent item in the list meets this criterion.
118 |
119 | 1. Source Code.
120 |
121 | The “source code” for a work means the preferred form of the work
122 | for making modifications to it. “Object code” means any non-source
123 | form of a work.
124 |
125 | A “Standard Interface” means an interface that either is an official
126 | standard defined by a recognized standards body, or, in the case of
127 | interfaces specified for a particular programming language, one that
128 | is widely used among developers working in that language.
129 |
130 | The “System Libraries” of an executable work include anything, other
131 | than the work as a whole, that (a) is included in the normal form of
132 | packaging a Major Component, but which is not part of that Major
133 | Component, and (b) serves only to enable use of the work with that
134 | Major Component, or to implement a Standard Interface for which an
135 | implementation is available to the public in source code form. A
136 | “Major Component”, in this context, means a major essential component
137 | (kernel, window system, and so on) of the specific operating system
138 | (if any) on which the executable work runs, or a compiler used to
139 | produce the work, or an object code interpreter used to run it.
140 |
141 | The “Corresponding Source” for a work in object code form means all
142 | the source code needed to generate, install, and (for an executable
143 | work) run the object code and to modify the work, including scripts to
144 | control those activities. However, it does not include the work's
145 | System Libraries, or general-purpose tools or generally available free
146 | programs which are used unmodified in performing those activities but
147 | which are not part of the work. For example, Corresponding Source
148 | includes interface definition files associated with source files for
149 | the work, and the source code for shared libraries and dynamically
150 | linked subprograms that the work is specifically designed to require,
151 | such as by intimate data communication or control flow between those
152 | subprograms and other parts of the work.
153 |
154 | The Corresponding Source need not include anything that users
155 | can regenerate automatically from other parts of the Corresponding
156 | Source.
157 |
158 | The Corresponding Source for a work in source code form is that
159 | same work.
160 |
161 | 2. Basic Permissions.
162 |
163 | All rights granted under this License are granted for the term of
164 | copyright on the Program, and are irrevocable provided the stated
165 | conditions are met. This License explicitly affirms your unlimited
166 | permission to run the unmodified Program. The output from running a
167 | covered work is covered by this License only if the output, given its
168 | content, constitutes a covered work. This License acknowledges your
169 | rights of fair use or other equivalent, as provided by copyright law.
170 |
171 | You may make, run and propagate covered works that you do not
172 | convey, without conditions so long as your license otherwise remains
173 | in force. You may convey covered works to others for the sole purpose
174 | of having them make modifications exclusively for you, or provide you
175 | with facilities for running those works, provided that you comply with
176 | the terms of this License in conveying all material for which you do
177 | not control copyright. Those thus making or running the covered works
178 | for you must do so exclusively on your behalf, under your direction
179 | and control, on terms that prohibit them from making any copies of
180 | your copyrighted material outside their relationship with you.
181 |
182 | Conveying under any other circumstances is permitted solely under
183 | the conditions stated below. Sublicensing is not allowed; section 10
184 | makes it unnecessary.
185 |
186 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
187 |
188 | No covered work shall be deemed part of an effective technological
189 | measure under any applicable law fulfilling obligations under article
190 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
191 | similar laws prohibiting or restricting circumvention of such
192 | measures.
193 |
194 | When you convey a covered work, you waive any legal power to forbid
195 | circumvention of technological measures to the extent such circumvention
196 | is effected by exercising rights under this License with respect to
197 | the covered work, and you disclaim any intention to limit operation or
198 | modification of the work as a means of enforcing, against the work's
199 | users, your or third parties' legal rights to forbid circumvention of
200 | technological measures.
201 |
202 | 4. Conveying Verbatim Copies.
203 |
204 | You may convey verbatim copies of the Program's source code as you
205 | receive it, in any medium, provided that you conspicuously and
206 | appropriately publish on each copy an appropriate copyright notice;
207 | keep intact all notices stating that this License and any
208 | non-permissive terms added in accord with section 7 apply to the code;
209 | keep intact all notices of the absence of any warranty; and give all
210 | recipients a copy of this License along with the Program.
211 |
212 | You may charge any price or no price for each copy that you convey,
213 | and you may offer support or warranty protection for a fee.
214 |
215 | 5. Conveying Modified Source Versions.
216 |
217 | You may convey a work based on the Program, or the modifications to
218 | produce it from the Program, in the form of source code under the
219 | terms of section 4, provided that you also meet all of these conditions:
220 |
221 |
222 | - a) The work must carry prominent notices stating that you modified
223 | it, and giving a relevant date.
224 |
225 | - b) The work must carry prominent notices stating that it is
226 | released under this License and any conditions added under section
227 | 7. This requirement modifies the requirement in section 4 to
228 | “keep intact all notices”.
229 |
230 | - c) You must license the entire work, as a whole, under this
231 | License to anyone who comes into possession of a copy. This
232 | License will therefore apply, along with any applicable section 7
233 | additional terms, to the whole of the work, and all its parts,
234 | regardless of how they are packaged. This License gives no
235 | permission to license the work in any other way, but it does not
236 | invalidate such permission if you have separately received it.
237 |
238 | - d) If the work has interactive user interfaces, each must display
239 | Appropriate Legal Notices; however, if the Program has interactive
240 | interfaces that do not display Appropriate Legal Notices, your
241 | work need not make them do so.
242 |
243 |
244 | A compilation of a covered work with other separate and independent
245 | works, which are not by their nature extensions of the covered work,
246 | and which are not combined with it such as to form a larger program,
247 | in or on a volume of a storage or distribution medium, is called an
248 | “aggregate” if the compilation and its resulting copyright are not
249 | used to limit the access or legal rights of the compilation's users
250 | beyond what the individual works permit. Inclusion of a covered work
251 | in an aggregate does not cause this License to apply to the other
252 | parts of the aggregate.
253 |
254 | 6. Conveying Non-Source Forms.
255 |
256 | You may convey a covered work in object code form under the terms
257 | of sections 4 and 5, provided that you also convey the
258 | machine-readable Corresponding Source under the terms of this License,
259 | in one of these ways:
260 |
261 |
262 | - a) Convey the object code in, or embodied in, a physical product
263 | (including a physical distribution medium), accompanied by the
264 | Corresponding Source fixed on a durable physical medium
265 | customarily used for software interchange.
266 |
267 | - b) Convey the object code in, or embodied in, a physical product
268 | (including a physical distribution medium), accompanied by a
269 | written offer, valid for at least three years and valid for as
270 | long as you offer spare parts or customer support for that product
271 | model, to give anyone who possesses the object code either (1) a
272 | copy of the Corresponding Source for all the software in the
273 | product that is covered by this License, on a durable physical
274 | medium customarily used for software interchange, for a price no
275 | more than your reasonable cost of physically performing this
276 | conveying of source, or (2) access to copy the
277 | Corresponding Source from a network server at no charge.
278 |
279 | - c) Convey individual copies of the object code with a copy of the
280 | written offer to provide the Corresponding Source. This
281 | alternative is allowed only occasionally and noncommercially, and
282 | only if you received the object code with such an offer, in accord
283 | with subsection 6b.
284 |
285 | - d) Convey the object code by offering access from a designated
286 | place (gratis or for a charge), and offer equivalent access to the
287 | Corresponding Source in the same way through the same place at no
288 | further charge. You need not require recipients to copy the
289 | Corresponding Source along with the object code. If the place to
290 | copy the object code is a network server, the Corresponding Source
291 | may be on a different server (operated by you or a third party)
292 | that supports equivalent copying facilities, provided you maintain
293 | clear directions next to the object code saying where to find the
294 | Corresponding Source. Regardless of what server hosts the
295 | Corresponding Source, you remain obligated to ensure that it is
296 | available for as long as needed to satisfy these requirements.
297 |
298 | - e) Convey the object code using peer-to-peer transmission, provided
299 | you inform other peers where the object code and Corresponding
300 | Source of the work are being offered to the general public at no
301 | charge under subsection 6d.
302 |
303 |
304 | A separable portion of the object code, whose source code is excluded
305 | from the Corresponding Source as a System Library, need not be
306 | included in conveying the object code work.
307 |
308 | A “User Product” is either (1) a “consumer product”, which means any
309 | tangible personal property which is normally used for personal, family,
310 | or household purposes, or (2) anything designed or sold for incorporation
311 | into a dwelling. In determining whether a product is a consumer product,
312 | doubtful cases shall be resolved in favor of coverage. For a particular
313 | product received by a particular user, “normally used” refers to a
314 | typical or common use of that class of product, regardless of the status
315 | of the particular user or of the way in which the particular user
316 | actually uses, or expects or is expected to use, the product. A product
317 | is a consumer product regardless of whether the product has substantial
318 | commercial, industrial or non-consumer uses, unless such uses represent
319 | the only significant mode of use of the product.
320 |
321 | “Installation Information” for a User Product means any methods,
322 | procedures, authorization keys, or other information required to install
323 | and execute modified versions of a covered work in that User Product from
324 | a modified version of its Corresponding Source. The information must
325 | suffice to ensure that the continued functioning of the modified object
326 | code is in no case prevented or interfered with solely because
327 | modification has been made.
328 |
329 | If you convey an object code work under this section in, or with, or
330 | specifically for use in, a User Product, and the conveying occurs as
331 | part of a transaction in which the right of possession and use of the
332 | User Product is transferred to the recipient in perpetuity or for a
333 | fixed term (regardless of how the transaction is characterized), the
334 | Corresponding Source conveyed under this section must be accompanied
335 | by the Installation Information. But this requirement does not apply
336 | if neither you nor any third party retains the ability to install
337 | modified object code on the User Product (for example, the work has
338 | been installed in ROM).
339 |
340 | The requirement to provide Installation Information does not include a
341 | requirement to continue to provide support service, warranty, or updates
342 | for a work that has been modified or installed by the recipient, or for
343 | the User Product in which it has been modified or installed. Access to a
344 | network may be denied when the modification itself materially and
345 | adversely affects the operation of the network or violates the rules and
346 | protocols for communication across the network.
347 |
348 | Corresponding Source conveyed, and Installation Information provided,
349 | in accord with this section must be in a format that is publicly
350 | documented (and with an implementation available to the public in
351 | source code form), and must require no special password or key for
352 | unpacking, reading or copying.
353 |
354 | 7. Additional Terms.
355 |
356 | “Additional permissions” are terms that supplement the terms of this
357 | License by making exceptions from one or more of its conditions.
358 | Additional permissions that are applicable to the entire Program shall
359 | be treated as though they were included in this License, to the extent
360 | that they are valid under applicable law. If additional permissions
361 | apply only to part of the Program, that part may be used separately
362 | under those permissions, but the entire Program remains governed by
363 | this License without regard to the additional permissions.
364 |
365 | When you convey a copy of a covered work, you may at your option
366 | remove any additional permissions from that copy, or from any part of
367 | it. (Additional permissions may be written to require their own
368 | removal in certain cases when you modify the work.) You may place
369 | additional permissions on material, added by you to a covered work,
370 | for which you have or can give appropriate copyright permission.
371 |
372 | Notwithstanding any other provision of this License, for material you
373 | add to a covered work, you may (if authorized by the copyright holders of
374 | that material) supplement the terms of this License with terms:
375 |
376 |
377 | - a) Disclaiming warranty or limiting liability differently from the
378 | terms of sections 15 and 16 of this License; or
379 |
380 | - b) Requiring preservation of specified reasonable legal notices or
381 | author attributions in that material or in the Appropriate Legal
382 | Notices displayed by works containing it; or
383 |
384 | - c) Prohibiting misrepresentation of the origin of that material, or
385 | requiring that modified versions of such material be marked in
386 | reasonable ways as different from the original version; or
387 |
388 | - d) Limiting the use for publicity purposes of names of licensors or
389 | authors of the material; or
390 |
391 | - e) Declining to grant rights under trademark law for use of some
392 | trade names, trademarks, or service marks; or
393 |
394 | - f) Requiring indemnification of licensors and authors of that
395 | material by anyone who conveys the material (or modified versions of
396 | it) with contractual assumptions of liability to the recipient, for
397 | any liability that these contractual assumptions directly impose on
398 | those licensors and authors.
399 |
400 |
401 | All other non-permissive additional terms are considered “further
402 | restrictions” within the meaning of section 10. If the Program as you
403 | received it, or any part of it, contains a notice stating that it is
404 | governed by this License along with a term that is a further
405 | restriction, you may remove that term. If a license document contains
406 | a further restriction but permits relicensing or conveying under this
407 | License, you may add to a covered work material governed by the terms
408 | of that license document, provided that the further restriction does
409 | not survive such relicensing or conveying.
410 |
411 | If you add terms to a covered work in accord with this section, you
412 | must place, in the relevant source files, a statement of the
413 | additional terms that apply to those files, or a notice indicating
414 | where to find the applicable terms.
415 |
416 | Additional terms, permissive or non-permissive, may be stated in the
417 | form of a separately written license, or stated as exceptions;
418 | the above requirements apply either way.
419 |
420 | 8. Termination.
421 |
422 | You may not propagate or modify a covered work except as expressly
423 | provided under this License. Any attempt otherwise to propagate or
424 | modify it is void, and will automatically terminate your rights under
425 | this License (including any patent licenses granted under the third
426 | paragraph of section 11).
427 |
428 | However, if you cease all violation of this License, then your
429 | license from a particular copyright holder is reinstated (a)
430 | provisionally, unless and until the copyright holder explicitly and
431 | finally terminates your license, and (b) permanently, if the copyright
432 | holder fails to notify you of the violation by some reasonable means
433 | prior to 60 days after the cessation.
434 |
435 | Moreover, your license from a particular copyright holder is
436 | reinstated permanently if the copyright holder notifies you of the
437 | violation by some reasonable means, this is the first time you have
438 | received notice of violation of this License (for any work) from that
439 | copyright holder, and you cure the violation prior to 30 days after
440 | your receipt of the notice.
441 |
442 | Termination of your rights under this section does not terminate the
443 | licenses of parties who have received copies or rights from you under
444 | this License. If your rights have been terminated and not permanently
445 | reinstated, you do not qualify to receive new licenses for the same
446 | material under section 10.
447 |
448 | 9. Acceptance Not Required for Having Copies.
449 |
450 | You are not required to accept this License in order to receive or
451 | run a copy of the Program. Ancillary propagation of a covered work
452 | occurring solely as a consequence of using peer-to-peer transmission
453 | to receive a copy likewise does not require acceptance. However,
454 | nothing other than this License grants you permission to propagate or
455 | modify any covered work. These actions infringe copyright if you do
456 | not accept this License. Therefore, by modifying or propagating a
457 | covered work, you indicate your acceptance of this License to do so.
458 |
459 | 10. Automatic Licensing of Downstream Recipients.
460 |
461 | Each time you convey a covered work, the recipient automatically
462 | receives a license from the original licensors, to run, modify and
463 | propagate that work, subject to this License. You are not responsible
464 | for enforcing compliance by third parties with this License.
465 |
466 | An “entity transaction” is a transaction transferring control of an
467 | organization, or substantially all assets of one, or subdividing an
468 | organization, or merging organizations. If propagation of a covered
469 | work results from an entity transaction, each party to that
470 | transaction who receives a copy of the work also receives whatever
471 | licenses to the work the party's predecessor in interest had or could
472 | give under the previous paragraph, plus a right to possession of the
473 | Corresponding Source of the work from the predecessor in interest, if
474 | the predecessor has it or can get it with reasonable efforts.
475 |
476 | You may not impose any further restrictions on the exercise of the
477 | rights granted or affirmed under this License. For example, you may
478 | not impose a license fee, royalty, or other charge for exercise of
479 | rights granted under this License, and you may not initiate litigation
480 | (including a cross-claim or counterclaim in a lawsuit) alleging that
481 | any patent claim is infringed by making, using, selling, offering for
482 | sale, or importing the Program or any portion of it.
483 |
484 | 11. Patents.
485 |
486 | A “contributor” is a copyright holder who authorizes use under this
487 | License of the Program or a work on which the Program is based. The
488 | work thus licensed is called the contributor's “contributor version”.
489 |
490 | A contributor's “essential patent claims” are all patent claims
491 | owned or controlled by the contributor, whether already acquired or
492 | hereafter acquired, that would be infringed by some manner, permitted
493 | by this License, of making, using, or selling its contributor version,
494 | but do not include claims that would be infringed only as a
495 | consequence of further modification of the contributor version. For
496 | purposes of this definition, “control” includes the right to grant
497 | patent sublicenses in a manner consistent with the requirements of
498 | this License.
499 |
500 | Each contributor grants you a non-exclusive, worldwide, royalty-free
501 | patent license under the contributor's essential patent claims, to
502 | make, use, sell, offer for sale, import and otherwise run, modify and
503 | propagate the contents of its contributor version.
504 |
505 | In the following three paragraphs, a “patent license” is any express
506 | agreement or commitment, however denominated, not to enforce a patent
507 | (such as an express permission to practice a patent or covenant not to
508 | sue for patent infringement). To “grant” such a patent license to a
509 | party means to make such an agreement or commitment not to enforce a
510 | patent against the party.
511 |
512 | If you convey a covered work, knowingly relying on a patent license,
513 | and the Corresponding Source of the work is not available for anyone
514 | to copy, free of charge and under the terms of this License, through a
515 | publicly available network server or other readily accessible means,
516 | then you must either (1) cause the Corresponding Source to be so
517 | available, or (2) arrange to deprive yourself of the benefit of the
518 | patent license for this particular work, or (3) arrange, in a manner
519 | consistent with the requirements of this License, to extend the patent
520 | license to downstream recipients. “Knowingly relying” means you have
521 | actual knowledge that, but for the patent license, your conveying the
522 | covered work in a country, or your recipient's use of the covered work
523 | in a country, would infringe one or more identifiable patents in that
524 | country that you have reason to believe are valid.
525 |
526 | If, pursuant to or in connection with a single transaction or
527 | arrangement, you convey, or propagate by procuring conveyance of, a
528 | covered work, and grant a patent license to some of the parties
529 | receiving the covered work authorizing them to use, propagate, modify
530 | or convey a specific copy of the covered work, then the patent license
531 | you grant is automatically extended to all recipients of the covered
532 | work and works based on it.
533 |
534 | A patent license is “discriminatory” if it does not include within
535 | the scope of its coverage, prohibits the exercise of, or is
536 | conditioned on the non-exercise of one or more of the rights that are
537 | specifically granted under this License. You may not convey a covered
538 | work if you are a party to an arrangement with a third party that is
539 | in the business of distributing software, under which you make payment
540 | to the third party based on the extent of your activity of conveying
541 | the work, and under which the third party grants, to any of the
542 | parties who would receive the covered work from you, a discriminatory
543 | patent license (a) in connection with copies of the covered work
544 | conveyed by you (or copies made from those copies), or (b) primarily
545 | for and in connection with specific products or compilations that
546 | contain the covered work, unless you entered into that arrangement,
547 | or that patent license was granted, prior to 28 March 2007.
548 |
549 | Nothing in this License shall be construed as excluding or limiting
550 | any implied license or other defenses to infringement that may
551 | otherwise be available to you under applicable patent law.
552 |
553 | 12. No Surrender of Others' Freedom.
554 |
555 | If conditions are imposed on you (whether by court order, agreement or
556 | otherwise) that contradict the conditions of this License, they do not
557 | excuse you from the conditions of this License. If you cannot convey a
558 | covered work so as to satisfy simultaneously your obligations under this
559 | License and any other pertinent obligations, then as a consequence you may
560 | not convey it at all. For example, if you agree to terms that obligate you
561 | to collect a royalty for further conveying from those to whom you convey
562 | the Program, the only way you could satisfy both those terms and this
563 | License would be to refrain entirely from conveying the Program.
564 |
565 | 13. Use with the GNU Affero General Public License.
566 |
567 | Notwithstanding any other provision of this License, you have
568 | permission to link or combine any covered work with a work licensed
569 | under version 3 of the GNU Affero General Public License into a single
570 | combined work, and to convey the resulting work. The terms of this
571 | License will continue to apply to the part which is the covered work,
572 | but the special requirements of the GNU Affero General Public License,
573 | section 13, concerning interaction through a network will apply to the
574 | combination as such.
575 |
576 | 14. Revised Versions of this License.
577 |
578 | The Free Software Foundation may publish revised and/or new versions of
579 | the GNU General Public License from time to time. Such new versions will
580 | be similar in spirit to the present version, but may differ in detail to
581 | address new problems or concerns.
582 |
583 | Each version is given a distinguishing version number. If the
584 | Program specifies that a certain numbered version of the GNU General
585 | Public License “or any later version” applies to it, you have the
586 | option of following the terms and conditions either of that numbered
587 | version or of any later version published by the Free Software
588 | Foundation. If the Program does not specify a version number of the
589 | GNU General Public License, you may choose any version ever published
590 | by the Free Software Foundation.
591 |
592 | If the Program specifies that a proxy can decide which future
593 | versions of the GNU General Public License can be used, that proxy's
594 | public statement of acceptance of a version permanently authorizes you
595 | to choose that version for the Program.
596 |
597 | Later license versions may give you additional or different
598 | permissions. However, no additional obligations are imposed on any
599 | author or copyright holder as a result of your choosing to follow a
600 | later version.
601 |
602 | 15. Disclaimer of Warranty.
603 |
604 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
605 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
606 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
607 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
608 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
609 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
610 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
611 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
612 |
613 | 16. Limitation of Liability.
614 |
615 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
616 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
617 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
618 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
619 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
620 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
621 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
622 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
623 | SUCH DAMAGES.
624 |
625 | 17. Interpretation of Sections 15 and 16.
626 |
627 | If the disclaimer of warranty and limitation of liability provided
628 | above cannot be given local legal effect according to their terms,
629 | reviewing courts shall apply local law that most closely approximates
630 | an absolute waiver of all civil liability in connection with the
631 | Program, unless a warranty or assumption of liability accompanies a
632 | copy of the Program in return for a fee.
633 |
634 | END OF TERMS AND CONDITIONS
635 |
636 | How to Apply These Terms to Your New Programs
637 |
638 | If you develop a new program, and you want it to be of the greatest
639 | possible use to the public, the best way to achieve this is to make it
640 | free software which everyone can redistribute and change under these terms.
641 |
642 | To do so, attach the following notices to the program. It is safest
643 | to attach them to the start of each source file to most effectively
644 | state the exclusion of warranty; and each file should have at least
645 | the “copyright” line and a pointer to where the full notice is found.
646 |
647 | <one line to give the program's name and a brief idea of what it does.>
648 | Copyright (C) <year> <name of author>
649 |
650 | This program is free software: you can redistribute it and/or modify
651 | it under the terms of the GNU General Public License as published by
652 | the Free Software Foundation, either version 3 of the License, or
653 | (at your option) any later version.
654 |
655 | This program is distributed in the hope that it will be useful,
656 | but WITHOUT ANY WARRANTY; without even the implied warranty of
657 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
658 | GNU General Public License for more details.
659 |
660 | You should have received a copy of the GNU General Public License
661 | along with this program. If not, see <http://www.gnu.org/licenses/>.
662 |
663 |
664 | Also add information on how to contact you by electronic and paper mail.
665 |
666 | If the program does terminal interaction, make it output a short
667 | notice like this when it starts in an interactive mode:
668 |
669 | <program> Copyright (C) <year> <name of author>
670 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
671 | This is free software, and you are welcome to redistribute it
672 | under certain conditions; type `show c' for details.
673 |
674 |
675 | The hypothetical commands `show w' and `show c' should show the appropriate
676 | parts of the General Public License. Of course, your program's commands
677 | might be different; for a GUI interface, you would use an “about box”.
678 |
679 | You should also get your employer (if you work as a programmer) or school,
680 | if any, to sign a “copyright disclaimer” for the program, if necessary.
681 | For more information on this, and how to apply and follow the GNU GPL, see
682 | <http://www.gnu.org/licenses/>.
683 |
684 | The GNU General Public License does not permit incorporating your program
685 | into proprietary programs. If your program is a subroutine library, you
686 | may consider it more useful to permit linking proprietary applications with
687 | the library. If this is what you want to do, use the GNU Lesser General
688 | Public License instead of this License. But first, please read
689 | <http://www.gnu.org/philosophy/why-not-lgpl.html>.
690 |
691 |
692 |
--------------------------------------------------------------------------------
/License/gpl-3.0.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = src
2 | dist_doc_DATA =
3 | dist_doc_DATA += ReadMe.html
4 | dist_doc_DATA += Install.html
5 | dist_doc_DATA += Documents.html
6 | dist_doc_DATA += License/gpl-3.0.txt
7 |
8 |
--------------------------------------------------------------------------------
/Makefile_OpenWrt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2006-2008 OpenWrt.org
3 | #
4 | # This is free software, licensed under the GNU General Public License v2.
5 | # See /LICENSE for more information.
6 | #
7 |
8 | include $(TOPDIR)/rules.mk
9 |
10 | PKG_NAME:=njit8021xclient
11 | PKG_RELEASE:=testing
12 | PKG_VERSION:=1.3
13 | PKG_SOURCE_URL:=@SF/$(PKG_NAME)
14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 |
16 | include $(INCLUDE_DIR)/package.mk
17 |
18 | define Package/njit8021xclient
19 | SECTION:=net
20 | CATEGORY:=Network
21 | TITLE:=NJIT 802.1X client program
22 | URL:=http://liuqun.github.com/njit8021xclient
23 | DEPENDS:=+libpcap
24 | PKG_BUILD_DEPENDS:=+libopenssl
25 | endef
26 |
27 | define Package/njit8021xclient/Default/description
28 | 802.1X client from Nanjing Institude of Technology,
29 | compatable with H3C iNode 802.1X client.
30 | Support H3C/iNode's private authentication protocol V2.40-V3.60
31 | endef
32 |
33 | CONFIGURE_ARGS += \
34 | --program-prefix="njit-" \
35 | $(NULL)
36 |
37 | define Build/Prepare
38 | $(call Build/Prepare/Default)
39 | endef
40 |
41 | define Build/Configure
42 | $(call Build/Configure/Default)
43 | endef
44 |
45 | define Package/njit8021xclient/install
46 | $(MAKE) -C $(PKG_BUILD_DIR) install-exec DESTDIR=$(1)
47 | endef
48 |
49 | define Package/njit8021xclient/conffiles
50 | /etc/config/njit8021xclient.conf
51 | endef
52 |
53 | define Package/njit8021xclient-web
54 | SECTION:=net
55 | CATEGORY:=Network
56 | TITLE:=LuCI pages for NJIT 802.1X client
57 | URL:=http://sourceforge.net/projects/njit8021xclient/
58 | DEPENDS:=njit8021xclient
59 | PKGARCH:=all
60 | endef
61 |
62 | define Package/njit8021xclient-web/description
63 | $(call Package/njit8021xclient/Default/description)
64 | This package contains LuCI web pages of njit8021xclient.
65 | It will help you to set your 802.1X login password.
66 | endef
67 |
68 | define Package/njit8021xclient-web/install
69 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
70 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
71 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
72 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/src-gui/luci/luci_controller_njit.lua \
73 | $(1)/usr/lib/lua/luci/controller/njit.lua
74 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/src-gui/luci/njit.lua \
75 | $(1)/usr/lib/lua/luci/model/cbi/njit.lua
76 | endef
77 |
78 |
79 | define Package/njit8021xclient/description
80 | $(call Package/njit8021xclient/Default/description)
81 | This package contains only the main program njit-client.
82 | endef
83 |
84 | $(eval $(call BuildPackage,njit8021xclient))
85 | $(eval $(call BuildPackage,njit8021xclient-web))
86 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | gdut8021xclient
2 | =========
3 |
4 | 广东某工业大学802.1X客户端
5 |
6 | 项目简介
7 | ---
8 | 本项目修改自njit8021xclient
9 |
10 | 编译安装
11 | ---
12 |
13 | 下载源代码
14 |
15 | ```
16 | git clone https://github.com/hazytint/gdut8021xclient.git
17 | cd gdut8021xclient/
18 | autoreconf --install #从GitHub下载的代码第一次编译时必须先执行以下命令以生成configure脚本
19 | ```
20 |
21 | 编译
22 |
23 | ```
24 | ./configure
25 | make
26 | ```
27 |
28 | 安装
29 |
30 | ```
31 | make install
32 | ```
33 |
34 | 使用方法
35 | ---
36 |
37 | ```
38 | sudo njit-client [username] [password] [interface]
39 | ```
40 |
41 | 帮助文档
42 | ---
43 | * [编译及安装](../master/Install.html)
44 | * [原项目简介](../master/ReadMe.html)
45 | * [原项目文档](../master/Documents.html)
46 |
47 | Copyright (C) 2013, by hazytint
48 |
--------------------------------------------------------------------------------
/ReadMe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | NJIT 802.1X Client -- ReadMe
4 |
5 |
6 |
7 | ===============================================================================
8 | 南京工程学院 - 校园网802.1X客户端 - 项目简介
9 | -------------------------------------------------------------------------------
10 | 本项目旨在解决使用Linux操作系统登陆华为802.1X校园网络的问题
11 | 兼容iNode V2.40-F0335,支持华为客户端版本号加密认证,支持用户名中存在特殊字符
12 | 目前njit-client在以下学校运行良好(感谢网友热心反馈):
13 | 南京工程学院、中南财经政法大学、华北电力大学、广东工业大学、长安大学
14 | 湖南大学、福建师范大学、山东大学、中南大学
15 | 部分学校由于使用了iNode V3.60-6202或更高版本H3C私有认证而造成登录后90秒掉线,尚无解决方案
16 | 如果您发现客户端在您学校无法使用,请发送Email到开发小组的邮件列表: njit8021xclient@googlegroups.com
17 |
18 | [编译和安装]
19 | 假如您打算从源代码开始重新编译客户端,请参考Install.html
20 | 如果您已经安装了编译好的客户端可执行文件,下面是具体的使用方法
21 |
22 | [使用方法]
23 | 假设您的H3C 802.1X帐号为s12345、密码为abcde
24 | 一、从开始菜单里找到“终端”,打开后进入命令提示符窗口
25 | 二、通过命令行切换为root并运行njit-client程序
26 | Ubuntu下命令格式为:
27 | sudo njit-client s12345 abcde
28 | RedHat/Fedora下命令格式为
29 | su -c "njit-client s12345 abcde"
30 | 三、程序会输出一些调试信息(因目前仍是测试版本),其中大部分信息不用理会,
31 | 只需关注如果包括[*] Server: Success.这样一行提示即为802.1X认证成功
32 | 如果提示为Server: Failure则为认证失败,另外还会输出"E????: ",这是服务器
33 | 发来的提示信息。
34 | 四、如果学校分配的是静态IP地址,则需要你在系统托盘中的网络管理程序中手动设置IP地址。
35 | 如果您需要帮助,请联系校园网802.1X客户端开发小组(发送Email至: njit8021xclient@googlegroups.com )
36 |
37 |
38 |
39 |
40 | [联系我们]
41 | 开发小组邮件列表/讨论板
42 | njit8021xclient@googlegroups.com
43 | http://groups.google.com/group/njit8021xclient?hl=zh-CN
44 |
45 | 校园网802.1X客户端交流QQ群(感谢jack235)
46 | 群号:86079951
47 |
48 | Wiki文档
49 | http://wiki.ubuntu.org.cn/南京工程学院802.1X客户端
50 |
51 | GitHub开源项目托管
52 | http://github.com/liuqun/njit8021xclient
53 |
54 | SourceForge开源项目托管
55 | http://sourceforge.net/projects/njit8021xclient/
56 |
57 | [致谢]
58 | 感谢编写兼容客户端的先驱者们!
59 | 南京理工大学:AGanNo2、throqq
60 | 中国海洋大学:lfc (asklux AT gmail.com)
61 | 湖南大学: sunmingming
62 | 南京工程学院:俊采星驰
63 |
64 | 感谢开发团队全体成员以及热心参与测试的朋友们!
65 | 南京工程学院:
66 | 阿群 (liuqun68 AT gmail.com)
67 | zhaoguobin (njzhaoguobin AT 163.com)
68 | gaoke0820 (gaoke0820 AT 163.com)
69 | sos_21tc、瑞士菜刀、ccplus、leothinking、huyutao、Scofield_MC、MIXTER
70 | 中南财经政法大学:
71 | lamborrari (lamborrari AT 163.com)
72 | 广东工业大学:
73 | wfhwfh (wfhwfh AT gmail.com)
74 | jack235 (860181417 AT qq.com)
75 | opirus (opirus AT 21cn.com)
76 | Oscar Tang (mooooscar AT gmail.com)
77 | 长安大学:
78 | xchuoshan45 (xchuoshan45 AT 126.com)
79 | 湖南大学:
80 | btwc2005 (btwc2005 AT 163.com)
81 | 湖南城市学院:
82 | 商殇 (idea35 AT vip.qq.com)
83 | GitHub上参与开发的热心网友:
84 | maxiaojun AT github.com
85 |
86 | ===============================================================================
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/configure.ac:
--------------------------------------------------------------------------------
1 | dnl Run autoreconf --install to generate ./configure from this file
2 | AC_INIT([njit8021xclient],[1.3])
3 | AM_INIT_AUTOMAKE([-Wall -Werror foreign])
4 | AC_CONFIG_SUBDIRS([src])
5 | AC_CONFIG_FILES([
6 | Makefile
7 | ])
8 | AC_OUTPUT
9 |
10 |
--------------------------------------------------------------------------------
/help:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo "帮助您自动生成可发布的源码包..."
3 |
4 | echo "1、调用automake和autoconf等标准工具"
5 | autoreconf --install
6 | if test $? != 0 ; then
7 | echo "缺少标准开发工具automake autoconf,请先安装开发工具"
8 | exit 1
9 | fi
10 |
11 | echo "2、调用./configure脚本自动完成各项检查"
12 | ./configure
13 | if test $? != 0 ; then
14 | echo "缺少开发库,请参考Install.html文档安装所有开发工具"
15 | exit 2
16 | fi
17 |
18 | echo "3、调用make工具生成tar.gz源代码压缩包"
19 | make dist --quiet
20 | ls *.tar.gz || ls *.tar.bz2
21 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/AUTHORS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/AUTHORS
--------------------------------------------------------------------------------
/src-gui/gtkgui/COPYING:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/ChangeLog
--------------------------------------------------------------------------------
/src-gui/gtkgui/HACKING:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/HACKING
--------------------------------------------------------------------------------
/src-gui/gtkgui/Makefile.am:
--------------------------------------------------------------------------------
1 | ACLOCAL_AMFLAGS = -I m4
2 | SUBDIRS = \
3 | tests \
4 | po \
5 | $(NULL)
6 | EXTRA_DIST = HACKING
7 |
8 | bin_PROGRAMS = hello
9 | hello_SOURCES = hello.c hello.h config.c config.h
10 | hello_CPPFLAGS = @GTK_CFLAGS@
11 | hello_LDADD = @GTK_LIBS@
12 |
13 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/NEWS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/NEWS
--------------------------------------------------------------------------------
/src-gui/gtkgui/README:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/README
--------------------------------------------------------------------------------
/src-gui/gtkgui/config.c:
--------------------------------------------------------------------------------
1 | #ifdef HAVE_CONFIG_H
2 | #include "config.h"
3 | #endif
4 |
5 | #ifndef PACKAGE_NAME
6 | #define PACKAGE_NAME ""
7 | #endif
8 |
9 | #ifndef PACKAGE_VERSION
10 | #define PACKAGE_VERSION ""
11 | #endif
12 |
13 | #ifndef LOCALEDIR
14 | #define LOCALEDIR "/usr/local/share/locale"
15 | #endif
16 |
17 | #include "hello.h"
18 |
19 | const struct GlobalConfig g_config = {
20 | .package_name = PACKAGE_NAME,
21 | .package_version = PACKAGE_VERSION,
22 | .locale_dir = LOCALEDIR,
23 | };
24 |
25 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/configure.ac:
--------------------------------------------------------------------------------
1 | AC_PREREQ(2.60)
2 | AC_INIT([gtkhelloworld], [0.1])
3 | AC_CONFIG_AUX_DIR([build-aux])
4 | AC_CONFIG_MACRO_DIR([m4])
5 | AM_INIT_AUTOMAKE([1.9.6 -Wall -Werror dist-bzip2])
6 |
7 | AC_PROG_CC
8 | AM_PROG_CC_C_O
9 | AC_PROG_INSTALL
10 | AC_PROG_LIBTOOL
11 | AC_PROG_INTLTOOL
12 | ALL_LINGUAS="zh_CN"
13 | GETTEXT_PACKAGE="$PACKAGE"
14 | AC_SUBST(GETTEXT_PACKAGE)
15 | AM_GLIB_GNU_GETTEXT
16 | AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
17 | AM_PATH_GTK_2_0
18 |
19 | AC_CONFIG_HEADERS([config.h])
20 | AC_CONFIG_FILES([
21 | Makefile
22 | tests/Makefile
23 | po/Makefile.in
24 | ])
25 | AC_OUTPUT
26 |
27 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/hello.c:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include "hello.h"
9 |
10 | static void SendHelloWorld(gpointer);
11 |
12 | int main(int argc, char *argv[])
13 | {
14 | GtkWidget *win = NULL; /* The main window */
15 | GtkWidget *vbox = NULL; /* Packing box for the menu and toolbars */
16 | GtkWidget *menubar = NULL; /* The actual menubar */
17 | GtkWidget *toolbar = NULL; /* The actual toolbar */
18 | GtkActionGroup *action_group = NULL; /* Packing group for our Actions */
19 | GtkUIManager *menu_manager = NULL; /* The magic widget! */
20 | GError *error = NULL; /* For reporting exceptions or errors */
21 |
22 | /* Initialize translation text domain */
23 | bindtextdomain(g_config.package_name, g_config.locale_dir);
24 | bind_textdomain_codeset(g_config.package_name, "UTF-8");
25 | textdomain(g_config.package_name);
26 |
27 | /* Initialize GTK+ */
28 | g_log_set_handler("Gtk", G_LOG_LEVEL_WARNING, (GLogFunc) gtk_false, NULL);
29 | gtk_init(&argc, &argv);
30 | g_log_set_handler("Gtk", G_LOG_LEVEL_WARNING, g_log_default_handler, NULL);
31 |
32 | /* Create the main window */
33 | win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
34 | gtk_window_set_title(GTK_WINDOW(win), _("Hello World"));
35 | gtk_window_set_default_size(GTK_WINDOW(win), 400, 300);
36 | gtk_widget_realize(win);
37 |
38 | /* Create a vertical box to hold menubar and toolbar */
39 | vbox = gtk_vbox_new(FALSE, 0);
40 |
41 | /* Create menus */
42 | action_group = gtk_action_group_new("TestActions");
43 | gtk_action_group_set_translation_domain(action_group, g_config.package_name);
44 | menu_manager = gtk_ui_manager_new();
45 |
46 | /* Load UI from XML string */
47 | const gchar *UI =
48 | ""
49 | " "
50 | " "
56 | " "
57 | ""
58 | " "
59 | " "
60 | " "
61 | " "
62 | " "
63 | " "
64 | " "
65 | ""
66 | ;
67 | error = NULL;
68 | gtk_ui_manager_add_ui_from_string(menu_manager, UI, strlen(UI), &error);
69 |
70 | if (error)
71 | {
72 | g_message("building menus failed: %s", error->message);
73 | g_error_free(error);
74 | error = NULL;
75 | }
76 |
77 |
78 | /* Create a list of entries which are passed to the Action constructor.
79 | * This is a huge convenience over building Actions by hand.
80 | */
81 | const GtkActionEntry entries[] = {
82 | /**********************************/
83 | { "FileMenuAction", NULL,
84 | _("_File"), NULL,
85 | _("File operations"),
86 | NULL
87 | },
88 | /**********************************/
89 | { "SendAction", GTK_STOCK_EXECUTE,
90 | _("_Send"), "S",
91 | _("Send hello world to console"),
92 | G_CALLBACK(SendHelloWorld)
93 | },
94 | /**********************************/
95 | { "QuitAction", GTK_STOCK_QUIT,
96 | _("_Quit"), "Q",
97 | _("Quit"),
98 | G_CALLBACK(gtk_main_quit)
99 | },
100 | /**********************************/
101 | };
102 | /* Pack up our objects:
103 | * vbox -> win
104 | * actions -> action_group
105 | * action_group -> menu_manager
106 | */
107 | gtk_container_add(GTK_CONTAINER(win), vbox);
108 | gtk_action_group_add_actions(action_group, entries, G_N_ELEMENTS(entries), NULL);
109 | gtk_ui_manager_insert_action_group(menu_manager, action_group, 0);
110 |
111 | /* Get the menubar and the toolbar and put them in the vertical packing box */
112 | menubar = gtk_ui_manager_get_widget(menu_manager, "/MainMenuBar");
113 | gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
114 | toolbar = gtk_ui_manager_get_widget(menu_manager, "/MainToolbar");
115 | gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
116 |
117 |
118 | /* Connect signals */
119 | g_signal_connect(win, "destroy", gtk_main_quit, NULL);
120 |
121 | /* Make sure that the accelerators work */
122 | gtk_window_add_accel_group(GTK_WINDOW(win),
123 | gtk_ui_manager_get_accel_group(menu_manager));
124 |
125 | /* Enter the main loop */
126 | gtk_widget_show_all(win);
127 | gtk_main();
128 | return (0);
129 | }
130 |
131 | static void SendHelloWorld(gpointer p)
132 | {
133 | (void) p;
134 | g_print("%s\n", _("Hello world!"));
135 | }
136 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/hello.h:
--------------------------------------------------------------------------------
1 | #ifndef HELLO_H
2 | #define HELLO_H
3 |
4 | extern const struct GlobalConfig {
5 | const char *package_name;
6 | const char *package_version;
7 | const char *locale_dir;
8 | } g_config;
9 |
10 | #endif//HELLO_H
11 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/m4/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/m4/.gitignore
--------------------------------------------------------------------------------
/src-gui/gtkgui/po/Makefile.in.in:
--------------------------------------------------------------------------------
1 | # Makefile for program source directory in GNU NLS utilities package.
2 | # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper
3 | # Copyright (C) 2004-2008 Rodney Dawes
4 | #
5 | # This file may be copied and used freely without restrictions. It may
6 | # be used in projects which are not available under a GNU Public License,
7 | # but which still want to provide support for the GNU gettext functionality.
8 | #
9 | # - Modified by Owen Taylor to use GETTEXT_PACKAGE
10 | # instead of PACKAGE and to look for po2tbl in ./ not in intl/
11 | #
12 | # - Modified by jacob berkman to install
13 | # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
14 | #
15 | # - Modified by Rodney Dawes for use with intltool
16 | #
17 | # We have the following line for use by intltoolize:
18 | # INTLTOOL_MAKEFILE
19 |
20 | GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
21 | PACKAGE = @PACKAGE@
22 | VERSION = @VERSION@
23 |
24 | SHELL = @SHELL@
25 |
26 | srcdir = @srcdir@
27 | top_srcdir = @top_srcdir@
28 | top_builddir = @top_builddir@
29 | VPATH = @srcdir@
30 |
31 | prefix = @prefix@
32 | exec_prefix = @exec_prefix@
33 | datadir = @datadir@
34 | datarootdir = @datarootdir@
35 | libdir = @libdir@
36 | DATADIRNAME = @DATADIRNAME@
37 | itlocaledir = $(prefix)/$(DATADIRNAME)/locale
38 | subdir = po
39 | install_sh = @install_sh@
40 | # Automake >= 1.8 provides @mkdir_p@.
41 | # Until it can be supposed, use the safe fallback:
42 | mkdir_p = $(install_sh) -d
43 |
44 | INSTALL = @INSTALL@
45 | INSTALL_DATA = @INSTALL_DATA@
46 |
47 | GMSGFMT = @GMSGFMT@
48 | MSGFMT = @MSGFMT@
49 | XGETTEXT = @XGETTEXT@
50 | INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
51 | INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
52 | MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
53 | GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
54 |
55 | ALL_LINGUAS = @ALL_LINGUAS@
56 |
57 | PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
58 |
59 | USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
60 |
61 | USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
62 |
63 | POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
64 |
65 | DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
66 | EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
67 |
68 | POTFILES = \
69 | # This comment gets stripped out
70 |
71 | CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
72 |
73 | .SUFFIXES:
74 | .SUFFIXES: .po .pox .gmo .mo .msg .cat
75 |
76 | .po.pox:
77 | $(MAKE) $(GETTEXT_PACKAGE).pot
78 | $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
79 |
80 | .po.mo:
81 | $(MSGFMT) -o $@ $<
82 |
83 | .po.gmo:
84 | file=`echo $* | sed 's,.*/,,'`.gmo \
85 | && rm -f $$file && $(GMSGFMT) -o $$file $<
86 |
87 | .po.cat:
88 | sed -f ../intl/po2msg.sed < $< > $*.msg \
89 | && rm -f $@ && gencat $@ $*.msg
90 |
91 |
92 | all: all-@USE_NLS@
93 |
94 | all-yes: $(CATALOGS)
95 | all-no:
96 |
97 | $(GETTEXT_PACKAGE).pot: $(POTFILES)
98 | $(GENPOT)
99 |
100 | install: install-data
101 | install-data: install-data-@USE_NLS@
102 | install-data-no: all
103 | install-data-yes: all
104 | linguas="$(USE_LINGUAS)"; \
105 | for lang in $$linguas; do \
106 | dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
107 | $(mkdir_p) $$dir; \
108 | if test -r $$lang.gmo; then \
109 | $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
110 | echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
111 | else \
112 | $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
113 | echo "installing $(srcdir)/$$lang.gmo as" \
114 | "$$dir/$(GETTEXT_PACKAGE).mo"; \
115 | fi; \
116 | if test -r $$lang.gmo.m; then \
117 | $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
118 | echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
119 | else \
120 | if test -r $(srcdir)/$$lang.gmo.m ; then \
121 | $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
122 | $$dir/$(GETTEXT_PACKAGE).mo.m; \
123 | echo "installing $(srcdir)/$$lang.gmo.m as" \
124 | "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
125 | else \
126 | true; \
127 | fi; \
128 | fi; \
129 | done
130 |
131 | # Empty stubs to satisfy archaic automake needs
132 | dvi info ctags tags CTAGS TAGS ID:
133 |
134 | # Define this as empty until I found a useful application.
135 | install-exec installcheck:
136 |
137 | uninstall:
138 | linguas="$(USE_LINGUAS)"; \
139 | for lang in $$linguas; do \
140 | rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
141 | rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
142 | done
143 |
144 | check: all $(GETTEXT_PACKAGE).pot
145 | rm -f missing notexist
146 | srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
147 | if [ -r missing -o -r notexist ]; then \
148 | exit 1; \
149 | fi
150 |
151 | mostlyclean:
152 | rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
153 | rm -f .intltool-merge-cache
154 |
155 | clean: mostlyclean
156 |
157 | distclean: clean
158 | rm -f Makefile Makefile.in POTFILES stamp-it
159 | rm -f *.mo *.msg *.cat *.cat.m *.gmo
160 |
161 | maintainer-clean: distclean
162 | @echo "This command is intended for maintainers to use;"
163 | @echo "it deletes files that may require special tools to rebuild."
164 | rm -f Makefile.in.in
165 |
166 | distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
167 | dist distdir: $(DISTFILES)
168 | dists="$(DISTFILES)"; \
169 | extra_dists="$(EXTRA_DISTFILES)"; \
170 | for file in $$extra_dists; do \
171 | test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
172 | done; \
173 | for file in $$dists; do \
174 | test -f $$file || file="$(srcdir)/$$file"; \
175 | ln $$file $(distdir) 2> /dev/null \
176 | || cp -p $$file $(distdir); \
177 | done
178 |
179 | update-po: Makefile
180 | $(MAKE) $(GETTEXT_PACKAGE).pot
181 | tmpdir=`pwd`; \
182 | linguas="$(USE_LINGUAS)"; \
183 | for lang in $$linguas; do \
184 | echo "$$lang:"; \
185 | result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
186 | if $$result; then \
187 | if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
188 | rm -f $$tmpdir/$$lang.new.po; \
189 | else \
190 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
191 | :; \
192 | else \
193 | echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
194 | rm -f $$tmpdir/$$lang.new.po; \
195 | exit 1; \
196 | fi; \
197 | fi; \
198 | else \
199 | echo "msgmerge for $$lang.gmo failed!"; \
200 | rm -f $$tmpdir/$$lang.new.po; \
201 | fi; \
202 | done
203 |
204 | Makefile POTFILES: stamp-it
205 | @if test ! -f $@; then \
206 | rm -f stamp-it; \
207 | $(MAKE) stamp-it; \
208 | fi
209 |
210 | stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
211 | cd $(top_builddir) \
212 | && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
213 | $(SHELL) ./config.status
214 |
215 | # Tell versions [3.59,3.63) of GNU make not to export all variables.
216 | # Otherwise a system limit (for SysV at least) may be exceeded.
217 | .NOEXPORT:
218 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/po/POTFILES.in:
--------------------------------------------------------------------------------
1 | hello.c
2 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/po/zh_CN.po:
--------------------------------------------------------------------------------
1 | # Chinese translations for njit-gui package
2 | # njit-gui 软件包的简体中文翻译.
3 | # Copyright (C) 2010 南京工程学院
4 | # This file is distributed under the same license as the njit-gui package.
5 | # 刘群 , 2010.
6 | #
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: njit-gui 1.0\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2010-09-20 00:54+0800\n"
12 | "PO-Revision-Date: 2010-09-19 12:51+0800\n"
13 | "Last-Translator: 刘群 \n"
14 | "Language-Team: Chinese (simplified)\n"
15 | "MIME-Version: 1.0\n"
16 | "Content-Type: text/plain; charset=UTF-8\n"
17 | "Content-Transfer-Encoding: 8bit\n"
18 |
19 | #: hello.c:35
20 | msgid "Hello World"
21 | msgstr "Hello World 测试小程序"
22 |
23 | #: hello.c:65
24 | msgid "_File"
25 | msgstr "文件(_F)"
26 |
27 | #: hello.c:66
28 | msgid "File operations"
29 | msgstr "文件操作"
30 |
31 | #: hello.c:71
32 | msgid "_Send"
33 | msgstr "发送(_S)"
34 |
35 | #: hello.c:72
36 | msgid "Send hello world to console"
37 | msgstr "发送字符串Hello World到控制台"
38 |
39 | #: hello.c:77
40 | msgid "_Quit"
41 | msgstr "退出(_Q)"
42 |
43 | #: hello.c:78
44 | msgid "Quit"
45 | msgstr "退出"
46 |
47 | #: hello.c:115
48 | msgid "Hello world!"
49 | msgstr "Hello World! 你好,世界!"
50 |
--------------------------------------------------------------------------------
/src-gui/gtkgui/tests/Makefile.am:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rxbit/gdut8021xclient/84dfd92503e1922d55affb9138806ed1e215421e/src-gui/gtkgui/tests/Makefile.am
--------------------------------------------------------------------------------
/src-gui/luci/luci_controller_njit.lua:
--------------------------------------------------------------------------------
1 | module("luci.controller.njit", package.seeall)
2 |
3 | function index()
4 | entry({"admin", "network", "njit"}, cbi("njit"), _("njit-client"), 88).i18n = "wol"
5 | end
6 |
--------------------------------------------------------------------------------
/src-gui/luci/njit.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 |
4 | Copyright 2010 Jo-Philipp Wich
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License");
7 | you may not use this file except in compliance with the License.
8 | You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 | ]]--
12 |
13 | local sys = require "luci.sys"
14 | local fs = require "nixio.fs"
15 |
16 | m = SimpleForm("njit", translate("njit-client"),
17 | translate("njit 802.11x client"))
18 |
19 | m.submit = translate("Connect")
20 | m.reset = false
21 |
22 | r = m:field(Value, "username", translate("Username"))
23 | s = m:field(Value, "password", translate("Password"))
24 | t = m:section(SimpleSection)
25 | interface = t:option(ListValue, "interface", translate("Network interface"))
26 | for _, e in ipairs(sys.net.devices()) do
27 | if e ~= "lo" then interface:value(e) end
28 | end
29 |
30 |
31 | function interface.write(self, s, val)
32 | local cmd
33 | local user = luci.http.formvalue("cbid.njit.1.username")
34 | local pass = luci.http.formvalue("cbid.njit.1.password")
35 | local iface = luci.http.formvalue("cbid.njit.1.interface")
36 | cmd = "njit-client %s %s %s & (sleep 10 && killall njit-client)" %{ user, pass, iface }
37 |
38 | local msg = "%s
%s
" %{
39 | translate("Starting njit-client:"), cmd
40 | }
41 |
42 | local p = io.popen(cmd .. " 2>&1")
43 | if p then
44 | while true do
45 | local l = p:read("*l")
46 | if l then
47 | if #l > 100 then l = l:sub(1, 100) .. "..." end
48 | msg = msg .. l .. "
"
49 | else
50 | break
51 | end
52 | end
53 | p:close()
54 | end
55 | msg = msg .. "
"
56 | m.message = msg
57 | end
58 |
59 | return m
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src-gui/luci/readme:
--------------------------------------------------------------------------------
1 | cp ./njit.lua /usr/lib/lua/luci/model/cbi/njit.lua
2 | cp ./luci_controller_njit.lua /usr/lib/lua/luci/controller/njit.lua
3 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/ReadMe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NJIT 802.1X Client - Qt GUI
5 |
6 |
7 | ===============================================================================
8 | 南京工程学院校园网802.1X客户端 - Qt用户界面
9 | -------------------------------------------------------------------------------
10 | [正文]
11 | (尚未在此处添加正文...)
12 |
13 | [致谢]
14 | 感谢客户端Qt用户界面作者 WangDiwen From 南京工程学院
15 | ===============================================================================
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/dialogs/mainDlg.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "mainDlg.h"
3 | //#include "main.h"
4 | //#include "auth.h"
5 | //#include "thread.h"
6 | //#include "debug.h"
7 |
8 | //extern pthread_t pthread;
9 | extern USER userinfo;
10 | MainDlg::MainDlg(QWidget *parent, Qt::WindowFlags f):QDialog(parent,f)
11 | {
12 | setWindowTitle(tr("xClient 802.1x"));
13 |
14 | Qt::WindowFlags flags = Qt::Window;
15 | flags |= Qt::WindowMinimizeButtonHint;
16 | flags |= Qt::WindowCloseButtonHint;
17 | setWindowFlags(flags);
18 |
19 | initDlg();
20 | createLeftLayout();
21 | createRightLayout();
22 | createBottomLayout();
23 | createMainLayout();
24 | setLayout(mainLayout);
25 |
26 | getInfo();
27 |
28 | connect(version,SIGNAL(clicked()),this,SLOT(showVersion()));
29 | connect(reset,SIGNAL(clicked()),this,SLOT(resetInfo()));
30 | connect(savePasswdBox,SIGNAL(toggled(bool)),\
31 | this,SLOT(saveInfo()));
32 | connect(start,SIGNAL(clicked()),this,SLOT(startNet()));
33 | connect(stop,SIGNAL(clicked()),this,SLOT(stopNet()));
34 | }
35 |
36 | MainDlg::~MainDlg()
37 | {
38 |
39 | }
40 |
41 | void MainDlg::getInfo()
42 | {
43 | QFile file("info.dat");
44 | file.open(QIODevice::ReadOnly);
45 | QDataStream in(&file);
46 |
47 | in.setVersion(QDataStream::Qt_4_0);
48 | qint32 magic;
49 | in>>magic;
50 | if (magic != (qint32)0xa1a2a3a4)
51 | {
52 | QMessageBox::information(this,"Tips",tr("Invalide file format"));
53 | return;
54 | }
55 |
56 | QString userName;
57 | QString passwd;
58 | int netcard;
59 | int startAuto;
60 | int savePasswd;
61 | in>>userName>>passwd>>netcard>>startAuto>>savePasswd;
62 |
63 | userEdit->setText(userName);
64 | passwdEdit->setText(passwd);
65 | //passwdEdit->setEchoMode(QLineEdit::Password);
66 | netcardEdit->setCurrentIndex(netcard);
67 | autoStart->setCheckState((startAuto != 0)?Qt::Checked:Qt::Unchecked);
68 | savePasswdBox->setCheckState((savePasswd != 0)?Qt::Unchecked:Qt::Checked);
69 |
70 | }
71 |
72 | void MainDlg::initDlg()
73 | {
74 | userLabel = new QLabel(tr("UserName"));
75 | passwdLabel = new QLabel(tr("Password"));
76 | netcardLabel = new QLabel(tr("NetCard"));
77 | stateLabel = new QLabel(tr("Status"));
78 |
79 | userEdit = new QLineEdit;
80 | passwdEdit = new QLineEdit;
81 | passwdEdit->setEchoMode(QLineEdit::Password);
82 | autoStart = new QCheckBox(tr("Auto Start"));
83 | savePasswdBox = new QCheckBox(tr("Save Passwd"));
84 | netcardEdit = new QComboBox;
85 | netcardEdit->insertItem(0,tr("eth0"));
86 | netcardEdit->insertItem(1,tr("eth1"));
87 | stateText = new QTextEdit;
88 | stateText->setText("Net state...");
89 | copyRight = new QLabel(tr("Author:WangDiwen(From njit) Date:2011-09-01"));
90 |
91 | labelIcon = new QLabel();
92 | QPixmap pic("./imags/pic.png");
93 |
94 | labelIcon->resize(pic.width(),pic.height());
95 | labelIcon->setPixmap(pic);
96 |
97 | start = new QPushButton();
98 | start->setText(tr("StartNet"));
99 | stop = new QPushButton();
100 | stop->setText(tr("StopNet"));
101 | stop->setEnabled(false);
102 | reset = new QPushButton();
103 | reset->setText(tr("ResetNet"));
104 | version = new QPushButton();
105 | version->setText(tr("Version"));
106 | }
107 |
108 | void MainDlg::createLeftLayout()
109 | {
110 | leftLayout = new QGridLayout();
111 | int labelCol = 0;
112 | int contentCol1 = 1;
113 |
114 | leftLayout->addWidget(userLabel,0,labelCol);
115 | leftLayout->addWidget(userEdit,0,contentCol1);
116 |
117 |
118 | leftLayout->addWidget(passwdLabel,1,labelCol);
119 | leftLayout->addWidget(passwdEdit,1,contentCol1);
120 |
121 |
122 | leftLayout->addWidget(netcardLabel,2,labelCol);
123 | leftLayout->addWidget(netcardEdit,2,contentCol1);
124 |
125 |
126 | leftLayout->addWidget(autoStart,3,labelCol);
127 | leftLayout->addWidget(savePasswdBox,3,contentCol1);
128 |
129 |
130 | leftLayout->addWidget(stateLabel,4,labelCol,Qt::AlignTop);
131 | leftLayout->addWidget(stateText,4,contentCol1);
132 |
133 | leftLayout->setColumnStretch(0,1);
134 | leftLayout->setColumnStretch(1,3);
135 |
136 | }
137 |
138 | void MainDlg::createRightLayout()
139 | {
140 | rightLayout = new QVBoxLayout();
141 |
142 | rightLayout->setMargin(10);
143 | rightLayout->setSpacing(10);
144 |
145 | rightLayout->addWidget(start);
146 | rightLayout->addWidget(stop);
147 | rightLayout->addWidget(reset);
148 | rightLayout->addWidget(version);
149 | rightLayout->addStretch();
150 | rightLayout->addWidget(labelIcon);
151 | //rightLayout->setSizeConstraint(QLayout::SetFixedSize);
152 | //rightLayout->setAlignment(Qt::AlignTop);
153 | }
154 |
155 |
156 | void MainDlg::createBottomLayout()
157 | {
158 | bottomLayout = new QHBoxLayout();
159 | bottomLayout->addWidget(copyRight);
160 | }
161 |
162 | void MainDlg::createMainLayout()
163 | {
164 | mainLayout = new QGridLayout(this);
165 |
166 | mainLayout->setMargin(10);
167 | mainLayout->setSpacing(10);
168 | mainLayout->addLayout(leftLayout,0,0);
169 | mainLayout->addLayout(rightLayout,0,1);
170 | mainLayout->addLayout(bottomLayout,1,0);
171 | mainLayout->setSizeConstraint(QLayout::SetFixedSize);
172 | }
173 |
174 | void MainDlg::startNet()
175 | {
176 | QString user = userEdit->text();
177 | QString pass = passwdEdit->text();
178 | QString net = netcardEdit->currentText();
179 |
180 | strcpy(userinfo.username,user.toLatin1().data());
181 | strcpy(userinfo.passwd,pass.toLatin1().data());
182 | strcpy(userinfo.netcard,net.toLatin1().data());
183 |
184 | //DPRINTF("user: %s\n",userinfo.username);
185 | //DPRINTF("pass: %s\n",userinfo.passwd);
186 | //DPRINTF("net: %s\n",userinfo.netcard);
187 | //Modified by WangDiwen(njit) for test;
188 | /**
189 | USER userinfo;
190 | userinfo.username = "s-208080236";
191 | userinfo.passwd = "126333";
192 | userinfo.netcard = "eth0";
193 | */
194 | int ret = -1/*pthread_create(&(pthread), NULL, thread_func, (void *)&userinfo)*/;
195 | if (ret != 0)
196 | {
197 | //exit(ret);
198 | std::cerr<<"create thread failed...\n";
199 | }
200 | std::clog<<"create thread success...\n";
201 | stateText->setText("Connect Server Success!\nIf your net has not connected yet,\nPlease clicked the button!\n");
202 | start->setEnabled(false);
203 | stop->setEnabled(true);
204 | userEdit->setEnabled(false);
205 | passwdEdit->setEnabled(false);
206 | netcardEdit->setEnabled(false);
207 | //pthread_join(pthread,NULL);
208 | }
209 |
210 | void MainDlg::stopNet()
211 | {
212 | //pthread_cancel(pthread);
213 | start->setEnabled(true);
214 | userEdit->setEnabled(true);
215 | passwdEdit->setEnabled(true);
216 | netcardEdit->setEnabled(true);
217 | stateText->setText("Stop Connect!");
218 | }
219 |
220 | void MainDlg::showVersion()
221 | {
222 | QMessageBox::information(this,"Version",tr("xClient 802.1x for Linux!\nBased on QT4.\n\nAuthor:WangDiwen(From njit)\nEmail:dw_wang126@126.com"));
223 | return;
224 | }
225 | void MainDlg::resetInfo()
226 | {
227 | userEdit->setText(tr(""));
228 | passwdEdit->setText(tr(""));
229 | netcardEdit->setCurrentIndex(0);
230 | stateText->setText(tr(""));
231 | return;
232 | }
233 | void MainDlg::saveInfo()
234 | {
235 | QString userName = userEdit->text();
236 | QString passwd = passwdEdit->text();
237 | int netcard = netcardEdit->currentIndex();
238 | int startAuto = autoStart->isChecked()? 1 : 0;
239 | int savePasswd = savePasswdBox->isChecked()? 1 : 0;
240 |
241 | QFile file("info.dat");
242 | file.open(QIODevice::WriteOnly);
243 | QDataStream out(&file);
244 |
245 | out.setVersion(QDataStream::Qt_4_0);
246 | out<<(qint32)0xa1a2a3a4;
247 | out<username,user->passwd,user->netcard)*/;
255 | if (ret == -1)
256 | {
257 | std::cerr<<"Authentication failed...\n";
258 | }
259 | std::clog<<"Authentication quit...\n";
260 | // pthread_exit(NULL);
261 | return NULL;
262 | }
263 |
264 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/dialogs/mainDlg.h:
--------------------------------------------------------------------------------
1 | #ifndef __MAINDLG_H__
2 | #define __MAINDLG_H__
3 |
4 | #include "main.h"
5 |
6 | class MainDlg : public QDialog
7 | {
8 | Q_OBJECT
9 | public:
10 | MainDlg(QWidget *parent = 0,Qt::WindowFlags f=0);
11 | ~MainDlg();
12 | void getInfo();
13 | public:
14 | QLabel *userLabel;
15 | QLineEdit *userEdit;
16 | QLabel *passwdLabel;
17 | QLineEdit *passwdEdit;
18 | QCheckBox *autoStart;
19 | QCheckBox *savePasswdBox;
20 |
21 | QLabel *netcardLabel;
22 | QComboBox *netcardEdit;
23 | QLabel *stateLabel;
24 | QTextEdit *stateText;
25 | QLabel *copyRight;
26 |
27 | QLabel *labelIcon;
28 | QPushButton *start;
29 | QPushButton *stop;
30 | QPushButton *reset;
31 | QPushButton *version;
32 | private:
33 | QGridLayout *leftLayout;
34 | QVBoxLayout *rightLayout;
35 | QHBoxLayout *bottomLayout;
36 | QGridLayout *mainLayout;
37 |
38 | public:
39 | void initDlg();
40 | void createLeftLayout();
41 | void createRightLayout();
42 | void createBottomLayout();
43 | void createMainLayout();
44 | public slots:
45 | void startNet();
46 | void stopNet();
47 | void showVersion();
48 | void resetInfo();
49 | void saveInfo();
50 | };
51 |
52 | #endif // __MAINDLG_H__
53 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "./dialogs/mainDlg.h"
3 | //#include
4 | //#include "thread.h"
5 |
6 | //pthread_t pthread;
7 | USER userinfo={ {'\0'},{'\0'},{'\0'} };
8 |
9 | int main(int argc, char **argv)
10 | {
11 | //QFont f("ZYSong 18030",12);
12 | //QApplication::setFont(f);
13 |
14 | QApplication app(argc,argv);
15 | MainDlg mainDlg;
16 | mainDlg.show();
17 |
18 | // app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
19 | return app.exec();
20 | }
21 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/main.h:
--------------------------------------------------------------------------------
1 | #ifndef __MAIN_H__
2 | #define __MAIN_H__
3 |
4 | #include
5 | //#include
6 | //#include
7 | //#include
8 | //#include
9 | //#include
10 | //#include
11 | //#include
12 | //#include
13 | //#include
14 | //#include
15 | //#include
16 |
17 | struct USER
18 | {
19 | char username[20];
20 | char passwd[10];
21 | char netcard[10];
22 | };
23 | void *thread_func(void * arg);
24 |
25 | #endif // __MAIN_H__
26 |
--------------------------------------------------------------------------------
/src-gui/qt4gui/qt4gui.pro:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Automatically generated by qmake (2.01a) ?? 9? 30 13:03:14 2011
3 | ######################################################################
4 |
5 | TEMPLATE = app
6 | TARGET =
7 | DEPENDPATH += .
8 | INCLUDEPATH += .
9 |
10 | # Input
11 | HEADERS += dialogs/mainDlg.h
12 | SOURCES += main.cpp dialogs/mainDlg.cpp
13 |
--------------------------------------------------------------------------------
/src/Makefile.am:
--------------------------------------------------------------------------------
1 | ACLOCAL_AMFLAGS = -I m4
2 | sbin_PROGRAMS = \
3 | client \
4 | $(NULL)
5 | client_SOURCES = \
6 | main.c \
7 | auth.c \
8 | fillmd5-libcrypto.c \
9 | njit8021xclient.c \
10 | njit8021xclient.h \
11 | debug.h \
12 | md5-buildin/md5_one.c \
13 | md5-buildin/md5_dgst.c \
14 | md5-buildin/mem_clr.c \
15 | $(NULL)
16 | sbin_SCRIPTS = \
17 | RefreshIP \
18 | $(null)
19 | EXTRA_DIST = $(sbin_SCRIPTS)
20 | CCOPT = $(V_CCOPT)
21 | DEFS = $(V_DEFS)
22 | INCLS = $(V_INCLS)
23 | client_CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
24 | client_CFLAGS += $(libcrypto_CFLAGS)
25 | client_LDADD = $(LBL_LIBS)
26 | #client_LDADD += $(libcrypto_LIBS)
27 |
28 |
--------------------------------------------------------------------------------
/src/RefreshIP:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | INTERFACE=${1:-eth0}
3 | if hash dhcpcd &> /dev/null; then
4 | echo "dhcpcd $INTERFACE"
5 | killall dhcpcd
6 | dhcpcd $INTERFACE
7 | elif hash dhclient &> /dev/null; then
8 | echo "dhclient $INTERFACE"
9 | killall dhclient
10 | dhclient -b $INTERFACE
11 | elif hash udhcpc &> /dev/null; then
12 | echo "udhcpc $INTERFACE"
13 | killall udhcpc
14 | udhcpc -t 0 -i $INTERFACE -b
15 | else
16 | echo "No DHCP client found!"
17 | fi
18 |
--------------------------------------------------------------------------------
/src/auth.c:
--------------------------------------------------------------------------------
1 | /* File: auth.c
2 | * ------------
3 | * 注:核心函数为Authentication(),由该函数执行801.1X认证
4 | */
5 |
6 | //int Authentication(const char *UserName, const char *Password, const char *DeviceName, const char *DHCPScript,const uint8_t *ClientMAC);
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | #include
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include "debug.h"
26 |
27 | // 自定义常量
28 | typedef enum {REQUEST=1, RESPONSE=2, SUCCESS=3, FAILURE=4, H3CDATA=10} EAP_Code;
29 | typedef enum {IDENTITY=1, NOTIFICATION=2, MD5=4, AVAILABLE=20} EAP_Type;
30 | typedef uint8_t EAP_ID;
31 | const uint8_t MultcastAddr[6] = {0x01,0x80,0xc2,0x00,0x00,0x03}; // 多播MAC地址
32 | const unsigned char H3cVersion[32] = "\006\007b2BcGRxWNXQtTExmJgR5fSpGmRU= ";
33 |
34 | // 子函数声明
35 | static void SendStartPkt(pcap_t *adhandle, const uint8_t mac[]);
36 | static void SendLogoffPkt(pcap_t *adhandle, const uint8_t mac[]);
37 | static void SendResponseIdentity(pcap_t *adhandle,
38 | const uint8_t request[],
39 | const uint8_t ethhdr[],
40 | const char username[]);
41 | static void SendResponseMD5(pcap_t *adhandle,
42 | const uint8_t request[],
43 | const uint8_t ethhdr[],
44 | const char username[],
45 | const char passwd[]);
46 | static void GetMacFromDevice(uint8_t mac[6], const char *devicename);
47 | // From fillmd5.c
48 | extern void FillMD5Area(uint8_t digest[],
49 | uint8_t id, const char passwd[], const uint8_t srcMD5[]);
50 |
51 |
52 |
53 | /**
54 | * 函数:Authentication()
55 | *
56 | * 使用以太网进行802.1X认证(802.1X Authentication)
57 | * 该函数将不断循环,应答802.1X认证会话,直到遇到错误后才退出
58 | */
59 |
60 | int Authentication(const char *UserName, const char *Password, const char *DeviceName, const char *DHCPScript,const uint8_t *ClientMAC)
61 | {
62 | char errbuf[PCAP_ERRBUF_SIZE];
63 | pcap_t *adhandle; // adapter handle
64 | uint8_t MAC[6]; // 本机地址
65 | char FilterStr[250];
66 | struct bpf_program fcode;
67 |
68 | // NOTE: 这里没有检查网线是否已插好,网线插口可能接触不良
69 |
70 | /* 打开适配器(网卡) */
71 | adhandle = pcap_create(DeviceName,errbuf);
72 | if (adhandle==NULL) {
73 | fprintf(stderr, "%s\n", errbuf);
74 | exit(-1);
75 | }
76 | pcap_set_promisc(adhandle,1);
77 | pcap_set_snaplen(adhandle,512);
78 | pcap_setdirection(adhandle,PCAP_D_IN);
79 | pcap_set_timeout(adhandle,1000);
80 | pcap_activate(adhandle);
81 |
82 | /* 查询本机MAC地址 */
83 | GetMacFromDevice(MAC, DeviceName);
84 | //memcpy(MAC,ClientMAC,6);
85 |
86 | /*
87 | * 设置过滤器:
88 | * 初始情况下只捕获发往本机的802.1X认证会话,不接收多播信息(避免误捕获其他客户端发出的多播信息)
89 | * 进入循环体前可以重设过滤器,那时再开始接收多播信息
90 | */
91 | sprintf(FilterStr, "(ether proto 0x888e) and (ether dst host %02x:%02x:%02x:%02x:%02x:%02x)",MAC[0],MAC[1],MAC[2],MAC[3],MAC[4],MAC[5]);
92 | pcap_compile(adhandle, &fcode, FilterStr, 1, PCAP_NETMASK_UNKNOWN);
93 | pcap_setfilter(adhandle, &fcode);
94 |
95 |
96 |
97 | START_AUTHENTICATION:
98 | {
99 | int retcode;
100 | struct pcap_pkthdr *header;
101 | const uint8_t *captured;
102 | uint8_t ethhdr[14]={0}; // ethernet header
103 |
104 | /* 主动发起认证会话 */
105 | DPRINTF("[ ] Client: Start.\n");
106 | /* 等待认证服务器的回应 */
107 | bool serverIsFound = false;
108 | while (!serverIsFound)
109 | {
110 | SendStartPkt(adhandle, MAC);
111 | retcode = pcap_next_ex(adhandle, &header, &captured);
112 | if (retcode==1 && (EAP_Code)captured[18]==REQUEST && (EAP_Type)captured[22] == IDENTITY) {
113 | serverIsFound = true;
114 | }
115 | else
116 | {
117 | DPRINTF(".");
118 | sleep(1);
119 | //SendStartPkt(adhandle, MAC);
120 | // NOTE: 这里没有检查网线是否接触不良或已被拔下
121 | }
122 | }
123 |
124 | // 填写应答包的报头(以后无须再修改)
125 | // 默认以单播方式应答802.1X认证设备发来的Request
126 | memcpy(ethhdr+0, captured+6, 6);
127 | memcpy(ethhdr+6, MAC, 6);
128 | ethhdr[12] = 0x88;
129 | ethhdr[13] = 0x8e;
130 |
131 | // 分情况应答下一个包
132 | if ((EAP_Type)captured[22] == IDENTITY)
133 | { // 通常情况会收到包Request Identity,应回答Response Identity
134 | DPRINTF("[%3d] Server: Request Identity!\n", captured[19]);
135 | SendResponseIdentity(adhandle, captured, ethhdr, UserName);
136 | DPRINTF("[%3d] Client: Response Identity.\n", (EAP_ID)captured[19]);
137 | }
138 |
139 | // 重设过滤器,只捕获华为802.1X认证设备发来的包(包括多播Request Identity / Request AVAILABLE)
140 | sprintf(FilterStr, "(ether proto 0x888e) and (ether src host %02x:%02x:%02x:%02x:%02x:%02x) and ((ether dst host %02x:%02x:%02x:%02x:%02x:%02x) or (ether dst host %02x:%02x:%02x:%02x:%02x:%02x))",
141 | captured[6],captured[7],captured[8],captured[9],captured[10],captured[11],
142 | MultcastAddr[0],MultcastAddr[1],MultcastAddr[2],MultcastAddr[3],MultcastAddr[4],MultcastAddr[5],
143 | MAC[0],MAC[1],MAC[2],MAC[3],MAC[4],MAC[5]);
144 | pcap_compile(adhandle, &fcode, FilterStr, 1, PCAP_NETMASK_UNKNOWN);
145 | pcap_setfilter(adhandle, &fcode);
146 |
147 | // 进入循环体
148 | for (;;)
149 | {
150 | // 调用pcap_next_ex()函数捕获数据包
151 | while (pcap_next_ex(adhandle, &header, &captured) != 1)
152 | {
153 | //DPRINTF("."); // 若捕获失败,则等1秒后重试
154 | //sleep(1); // 直到成功捕获到一个数据包后再跳出
155 | // NOTE: 这里没有检查网线是否已被拔下或插口接触不良
156 | }
157 |
158 | // 根据收到的Request,回复相应的Response包
159 | if ((EAP_Code)captured[18] == REQUEST)
160 | {
161 | switch ((EAP_Type)captured[22])
162 | {
163 | case IDENTITY:
164 | DPRINTF("[%3d] Server: Request Identity!\n", (EAP_ID)captured[19]);
165 | SendResponseIdentity(adhandle, captured, ethhdr, UserName);
166 | DPRINTF("[%3d] Client: Response Identity.\n", (EAP_ID)captured[19]);
167 | break;
168 | case MD5:
169 | DPRINTF("[%3d] Server: Request MD5-Challenge!\n", (EAP_ID)captured[19]);
170 | SendResponseMD5(adhandle, captured, ethhdr, UserName, Password);
171 | DPRINTF("[%3d] Client: Response MD5-Challenge.\n", (EAP_ID)captured[19]);
172 | break;
173 | default:
174 | DPRINTF("[%3d] Server: Request (type:%d)!\n", (EAP_ID)captured[19], (EAP_Type)captured[22]);
175 | DPRINTF("Error! Unexpected request type\n");
176 | exit(-1);
177 | break;
178 | }
179 | }
180 | else if ((EAP_Code)captured[18] == FAILURE)
181 | { // 处理认证失败信息
182 | uint8_t errtype = captured[22];
183 | uint8_t msgsize = captured[23];
184 | const char *msg = (const char*) &captured[24];
185 | DPRINTF("[%3d] Server: Failure.\n", (EAP_ID)captured[19]);
186 | if (errtype==0x09 && msgsize>0)
187 | { // 输出错误提示消息
188 | DPRINTF("errtype=0x%02x\n", errtype);
189 | fprintf(stderr, "%s\n", msg);
190 | // 已知的几种错误如下
191 | // E2531:用户名不存在
192 | // E2535:Service is paused
193 | // E2542:该用户帐号已经在别处登录
194 | // E2547:接入时段限制
195 | // E2553:密码错误
196 | // E2602:认证会话不存在
197 | // E3137:客户端版本号无效
198 | exit(-1);
199 | }
200 | else if (errtype==0x08) // 可能网络无流量时服务器结束此次802.1X认证会话
201 | { // 遇此情况客户端立刻发起新的认证会话
202 | goto START_AUTHENTICATION;
203 | }
204 | else
205 | {
206 | DPRINTF("errtype=0x%02x\n", errtype);
207 | fprintf(stderr, "%s\n", msg);
208 | //exit(-1);
209 | goto START_AUTHENTICATION;
210 | }
211 | }
212 | else if ((EAP_Code)captured[18] == SUCCESS)
213 | {
214 | DPRINTF("[%3d] Server: Success.\n", captured[19]);
215 | // 刷新IP地址
216 | system(DHCPScript);
217 | }
218 | else
219 | {
220 | DPRINTF("[%3d] Server: (H3C data)\n", captured[19]);
221 | // TODO: 这里没有处理华为自定义数据包
222 | }
223 | }
224 | }
225 | return (0);
226 | }
227 |
228 |
229 |
230 | static
231 | void GetMacFromDevice(uint8_t mac[6], const char *devicename)
232 | {
233 |
234 | int fd;
235 | int err;
236 | struct ifreq ifr;
237 |
238 | fd = socket(PF_PACKET, SOCK_RAW, htons(0x0806));
239 | assert(fd != -1);
240 |
241 | assert(strlen(devicename) < IFNAMSIZ);
242 | strncpy(ifr.ifr_name, devicename, IFNAMSIZ);
243 | ifr.ifr_addr.sa_family = AF_INET;
244 |
245 | err = ioctl(fd, SIOCGIFHWADDR, &ifr);
246 | assert(err != -1);
247 | memcpy(mac, ifr.ifr_hwaddr.sa_data, 6);
248 |
249 | err = close(fd);
250 | assert(err != -1);
251 | return;
252 | }
253 |
254 |
255 | static
256 | void SendStartPkt(pcap_t *handle, const uint8_t localmac[])
257 | {
258 | uint8_t packet[18];
259 |
260 | // Ethernet Header (14 Bytes)
261 | memcpy(packet+6, localmac, 6);
262 | packet[12] = 0x88;
263 | packet[13] = 0x8e;
264 |
265 | // EAPOL (4 Bytes)
266 | packet[14] = 0x01; // Version=1
267 | packet[15] = 0x01; // Type=Start
268 | packet[16] = packet[17] =0x00;// Length=0x0000
269 |
270 | // 多播发送Strat包
271 | memcpy(packet, MultcastAddr, 6);
272 | pcap_sendpacket(handle, packet, sizeof(packet));
273 | }
274 |
275 |
276 |
277 | static
278 | void SendResponseIdentity(pcap_t *adhandle, const uint8_t request[], const uint8_t ethhdr[], const char username[])
279 | {
280 | uint8_t response[128];
281 | size_t packetlen;
282 | uint16_t eaplen;
283 | int usernamelen;
284 |
285 | assert((EAP_Code)request[18] == REQUEST);
286 | assert((EAP_Type)request[22] == IDENTITY);
287 |
288 | usernamelen = strlen(username); //末尾添加用户名
289 | packetlen = 55 + usernamelen;
290 | eaplen = htons(packetlen-18);
291 |
292 | // Fill Ethernet header
293 | memcpy(response, ethhdr, 14);
294 |
295 | // 802,1X Authentication
296 | // {
297 | response[14] = 0x1; // 802.1X Version 1
298 | response[15] = 0x0; // Type=0 (EAP Packet)
299 | memcpy(response+16, &eaplen, sizeof(eaplen)); // Length
300 | // Extensible Authentication Protocol
301 | // {
302 | response[18] = (EAP_Code) RESPONSE; // Code
303 | response[19] = request[19]; // ID
304 | response[20] = response[16]; // Length
305 | response[21] = response[17]; //
306 | response[22] = (EAP_Type) IDENTITY; // Type
307 | // Type-Data
308 | // {
309 | memcpy(response+23, H3cVersion, 32);
310 | memcpy(response+55, username, usernamelen);
311 | assert(packetlen <= sizeof(response));
312 | // }
313 | // }
314 | // }
315 |
316 | // 补填前面留空的两处Length
317 | memcpy(response+16, &eaplen, sizeof(eaplen));
318 | memcpy(response+20, &eaplen, sizeof(eaplen));
319 |
320 | // 发送
321 | pcap_sendpacket(adhandle, response, packetlen);
322 | return;
323 | }
324 |
325 | static
326 | void SendResponseMD5(pcap_t *handle, const uint8_t request[], const uint8_t ethhdr[], const char username[], const char passwd[])
327 | {
328 | uint16_t eaplen;
329 | size_t usernamelen;
330 | size_t packetlen;
331 | uint8_t response[128];
332 |
333 | assert((EAP_Code)request[18] == REQUEST);
334 | assert((EAP_Type)request[22] == MD5);
335 |
336 | usernamelen = strlen(username);
337 | packetlen = 40+usernamelen; // ethhdr+EAPOL+EAP+usernamelen
338 | eaplen = htons(packetlen - 18);
339 |
340 | // Fill Ethernet header
341 | memcpy(response, ethhdr, 14);
342 |
343 | // 802,1X Authentication
344 | // {
345 | response[14] = 0x1; // 802.1X Version 1
346 | response[15] = 0x0; // Type=0 (EAP Packet)
347 | memcpy(response+16, &eaplen, sizeof(eaplen)); // Length
348 |
349 | // Extensible Authentication Protocol
350 | // {
351 | response[18] = (EAP_Code) RESPONSE;// Code
352 | response[19] = request[19]; // ID
353 | response[20] = response[16]; // Length
354 | response[21] = response[17]; //
355 | response[22] = (EAP_Type) MD5; // Type
356 | response[23] = 16; // Value-Size: 16 Bytes
357 | FillMD5Area(response+24, request[19], passwd, request+24);
358 | memcpy(response+40, username, usernamelen);
359 | // }
360 | // }
361 |
362 | pcap_sendpacket(handle, response, packetlen);
363 | }
364 |
365 | /*
366 | static
367 | void SendLogoffPkt(pcap_t *handle, const uint8_t localmac[])
368 | {
369 | uint8_t packet[18];
370 |
371 | // Ethernet Header (14 Bytes)
372 | memcpy(packet, MultcastAddr, 6);
373 | memcpy(packet+6, localmac, 6);
374 | packet[12] = 0x88;
375 | packet[13] = 0x8e;
376 |
377 | // EAPOL (4 Bytes)
378 | packet[14] = 0x01; // Version=1
379 | packet[15] = 0x02; // Type=Logoff
380 | packet[16] = 0x00;
381 | packet[17] = 0x00;// Length=0x0000
382 |
383 | // 发包
384 | pcap_sendpacket(handle, packet, sizeof(packet));
385 | }
386 |
387 | */
388 |
--------------------------------------------------------------------------------
/src/configure.ac:
--------------------------------------------------------------------------------
1 | AC_INIT([njit8021xclient],[1.0],[njit8021xclient@googlegroups.com],[],[https://github.com/liuqun/njit8021xclient])
2 |
3 | AC_MSG_CHECKING([program prefix for $PACKAGE_NAME]);
4 | if test "x$program_prefix" = "x" || test $program_prefix = "NONE" ; then
5 | dnl 可执行文件前缀默认值
6 | program_prefix="njit-"
7 | fi
8 | AC_MSG_RESULT([$program_prefix])
9 |
10 | AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
11 | AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
12 | AC_PROG_CC
13 | AM_PROG_CC_C_O
14 | AC_LBL_C_INIT(V_CCOPT, V_INCLS)
15 | AC_LBL_C_INLINE
16 | AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
17 | AC_SUBST(V_CCOPT)
18 | AC_SUBST(V_DEFS)
19 | AC_SUBST(V_GROUP)
20 | AC_SUBST(V_INCLS)
21 | AC_SUBST(V_PCAPDEP)
22 | PKG_CHECK_MODULES([libcrypto], [libcrypto])
23 | AC_CONFIG_HEADER([config.h])
24 | AC_CONFIG_FILES([
25 | Makefile
26 | ])
27 | AC_OUTPUT
28 |
29 |
--------------------------------------------------------------------------------
/src/debug.h:
--------------------------------------------------------------------------------
1 | /* File: debug.h
2 | * -------------
3 | * 定义少量用于调试的宏函数
4 | *
5 | */
6 |
7 | #ifndef DEBUG_H
8 | #define DEBUG_H
9 |
10 | /**
11 | * Macro: DPRINTF()
12 | *
13 | * Usage: 调用格式与printf()一致,支持变长参数表,例子如下:
14 | *
15 | * #include "debug.h"
16 | * ...
17 | * int errcode;
18 | * char message[] = "xxx failed!";
19 | * ...
20 | * DPRINTF("Debug message: errcode=%d\n", errcode);
21 | * DPRINTF("Debug message: $s\n", message);
22 | * exit(errcode);
23 | *
24 | * 在发布版中定义NDEBUG宏可以清除所有DPRINTF()信息
25 | * 注:宏NDEBUG源自C语言惯例
26 | *
27 | */
28 | #ifdef NDEBUG
29 | # define DPRINTF(...)
30 | #else
31 | # include // 导入函数原型fprintf(stderr,"%format",...)
32 | # define DPRINTF(...) fprintf(stderr, __VA_ARGS__)
33 | #endif
34 |
35 | #endif // DEBUG_H
36 |
--------------------------------------------------------------------------------
/src/decrypt.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | void DEStoMD5(uint8_t dest[],const uint8_t src[])
8 | {
9 | int i = 0;
10 | DES_cblock k1 = "\x00\x88\x01\x01\xd2\x42\xa4\x4a";
11 | DES_cblock k2 = "\xe0\x54\xf2\xd2\x73\xda\xae\x4d";
12 | DES_cblock k3 = "\x42\xf2\x18\x20\xd3\x72\x04\xbf";
13 | DES_key_schedule ks1, ks2, ks3;
14 | DES_set_key(&k1,&ks1);
15 | DES_set_key(&k2,&ks2);
16 | DES_set_key(&k3,&ks3);
17 | for (i = 0; i < 32; i += 8)
18 | {
19 | DES_ecb3_encrypt((const_DES_cblock *)(src+i), (const_DES_cblock *)(dest+i), &ks1, &ks2, &ks3, DES_DECRYPT);
20 | }
21 | (void) MD5(dest, 32, dest);
22 | (void) MD5(dest, 16, dest+16);
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/src/fillmd5-libcrypto.c:
--------------------------------------------------------------------------------
1 | /* File:
2 | * ---------------
3 | * 调用openssl提供的MD5函数
4 | */
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #include
11 |
12 |
13 | void FillMD5Area(uint8_t digest[], uint8_t id, const char passwd[], const uint8_t srcMD5[])
14 | {
15 | uint8_t msgbuf[128]; // msgbuf = ‘id‘ + ‘passwd’ + ‘srcMD5’
16 | size_t msglen;
17 | size_t passlen;
18 |
19 | passlen = strlen(passwd);
20 | msglen = 1 + passlen + 16;
21 | assert(sizeof(msgbuf) >= msglen);
22 |
23 | msgbuf[0] = id;
24 | memcpy(msgbuf+1, passwd, passlen);
25 | memcpy(msgbuf+1+passlen, srcMD5, 16);
26 |
27 | (void) MD5(msgbuf, msglen, digest);
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/src/m4/README:
--------------------------------------------------------------------------------
1 | Note:
2 | "tcpdump-aclocal.m4"来源自tcpdump代码中的aclocal.m4,它给autoconf提供检测libpcap的所有宏
3 |
4 |
--------------------------------------------------------------------------------
/src/main.c:
--------------------------------------------------------------------------------
1 | /* File: main.c
2 | * ------------
3 | * 校园网802.1X客户端命令行
4 | */
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | /* 子函数声明 */
15 | int Authentication(const char *UserName, const char *Password, const char *DeviceName, const char * DHCPScript, uint8_t *ClientMAC);
16 |
17 | static struct option arglist[] = {
18 | {"help", no_argument, NULL, 'h'},
19 | {"user", required_argument, NULL, 'u'},
20 | {"password", required_argument, NULL, 'p'},
21 | {"script", required_argument, NULL, 's'},
22 | {"iface", required_argument, NULL, 'i'},
23 | {NULL, 0, NULL, 0}
24 | };
25 |
26 | static const char usage_str[] = "usage: "
27 | " njit-client -u username -p password [-i interface] [-s dhcp_script]\n"
28 | " -h --help print this screen\n"
29 | " -u --user longin name\n"
30 | " -p --password password\n"
31 | " -s --script dhcp script\n"
32 | " -i --iface network interface (default eth0)\n";
33 |
34 | /**
35 | * 函数:main()
36 | *
37 | * 检查程序的执行权限,检查命令行参数格式。
38 | * 允许的调用格式包括:
39 | * njit-client -u username -p password
40 | * njit-client -u username -p password -i eth0
41 | * njit-client -u username -p password -i eth1 -s "dhcpcd"
42 | * 若没有从命令行指定网卡,则默认将使用eth0
43 | */
44 | int main(int argc, char *argv[])
45 | {
46 | int argval;
47 | char UserName[32] = "";
48 | char Password[32] = "";
49 | char DeviceName[16] = "eth0";
50 | char DHCPScript[128] = "";
51 | uint8_t ClientMAC[6] = {0xAA,0xBB,0xCC,0xDD,0xEE,0xFF};
52 | /* 检查当前是否具有root权限 */
53 | if (getuid() != 0) {
54 | fprintf(stderr, "抱歉,运行本客户端程序需要root权限\n");
55 | fprintf(stderr, "(RedHat/Fedora下使用su命令切换为root)\n");
56 | fprintf(stderr, "(Ubuntu/Debian下在命令前添加sudo)\n");
57 | exit(-1);
58 | }
59 |
60 | while ((argval = getopt_long(argc, argv, "u:p:i:s:h", arglist, NULL)) != -1) {
61 | switch (argval) {
62 | case 'h':
63 | printf(usage_str);
64 | exit(EXIT_SUCCESS);
65 | case 'u':
66 | strncpy(UserName, optarg, sizeof(UserName));
67 | break;
68 | case 'p':
69 | strncpy(Password, optarg, sizeof(Password));
70 | break;
71 | case 'i':
72 | strncpy(DeviceName, optarg, sizeof(DeviceName));
73 | break;
74 | case 's':
75 | strncpy(DHCPScript, optarg, sizeof(DHCPScript));
76 | break;
77 | default:
78 | break;
79 | }
80 | }
81 |
82 | if (strlen(UserName) == 0 ||
83 | strlen(Password) == 0 ||
84 | strlen(DeviceName) == 0) {
85 | printf(usage_str);
86 | exit(EXIT_SUCCESS);
87 | }
88 |
89 | /* 调用子函数完成802.1X认证 */
90 | Authentication(UserName, Password, DeviceName, DHCPScript,ClientMAC);
91 |
92 | return (EXIT_SUCCESS);
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/src/md5-buildin/md5_dgst.c:
--------------------------------------------------------------------------------
1 | /* crypto/md5/md5_dgst.c */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #include
60 | #include
61 | #include
62 |
63 | #include
64 | #include
65 | #include
66 |
67 | #ifndef MD5_LONG_LOG2
68 | #define MD5_LONG_LOG2 2 /* default to 32 bits */
69 | #endif
70 |
71 |
72 | #define DATA_ORDER_IS_LITTLE_ENDIAN
73 |
74 | typedef MD5_LONG HASH_LONG;
75 | typedef MD5_CTX HASH_CTX;
76 | const int HASH_CBLOCK=MD5_CBLOCK;
77 |
78 | static int HASH_Update (HASH_CTX *c, const void *data, size_t len);
79 | static void HASH_Transform (HASH_CTX *c, const unsigned char *data);
80 | static int HASH_FINAL (unsigned char *md, HASH_CTX *c);
81 | static void HASH_MAKE_STRING (HASH_CTX *c, unsigned char *s);
82 | static void HASH_BLOCK_DATA_ORDER (MD5_CTX *c, const void *p, size_t num);
83 |
84 |
85 | //#include "md32_common.h"
86 |
87 | /*
88 | * Engage compiler specific rotate intrinsic function if available.
89 | */
90 | #undef ROTATE
91 | #ifndef PEDANTIC
92 | # if defined(_MSC_VER) || defined(__ICC)
93 | # define ROTATE(a,n) _lrotl(a,n)
94 | # elif defined(__MWERKS__)
95 | # if defined(__POWERPC__)
96 | # define ROTATE(a,n) __rlwinm(a,n,0,31)
97 | # elif defined(__MC68K__)
98 | /* Motorola specific tweak. */
99 | # define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) )
100 | # else
101 | # define ROTATE(a,n) __rol(a,n)
102 | # endif
103 | # elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
104 | /*
105 | * Some GNU C inline assembler templates. Note that these are
106 | * rotates by *constant* number of bits! But that's exactly
107 | * what we need here...
108 | *
109 | */
110 | # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
111 | # define ROTATE(a,n) ({ register unsigned int ret; \
112 | asm ( \
113 | "roll %1,%0" \
114 | : "=r"(ret) \
115 | : "I"(n), "0"((unsigned int)(a)) \
116 | : "cc"); \
117 | ret; \
118 | })
119 | # elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
120 | defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__)
121 | # define ROTATE(a,n) ({ register unsigned int ret; \
122 | asm ( \
123 | "rlwinm %0,%1,%2,0,31" \
124 | : "=r"(ret) \
125 | : "r"(a), "I"(n)); \
126 | ret; \
127 | })
128 | # elif defined(__s390x__)
129 | # define ROTATE(a,n) ({ register unsigned int ret; \
130 | asm ("rll %0,%1,%2" \
131 | : "=r"(ret) \
132 | : "r"(a), "I"(n)); \
133 | ret; \
134 | })
135 | # endif
136 | # endif
137 | #endif /* PEDANTIC */
138 |
139 | #ifndef ROTATE
140 | #define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
141 | #endif
142 |
143 | #if defined(DATA_ORDER_IS_BIG_ENDIAN)
144 |
145 | #ifndef PEDANTIC
146 | # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
147 | # if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \
148 | (defined(__x86_64) || defined(__x86_64__))
149 | # if !defined(B_ENDIAN)
150 | /*
151 | * This gives ~30-40% performance improvement in SHA-256 compiled
152 | * with gcc [on P4]. Well, first macro to be frank. We can pull
153 | * this trick on x86* platforms only, because these CPUs can fetch
154 | * unaligned data without raising an exception.
155 | */
156 | # define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \
157 | asm ("bswapl %0":"=r"(r):"0"(r)); \
158 | (c)+=4; (l)=r; })
159 | # define HOST_l2c(l,c) ({ unsigned int r=(l); \
160 | asm ("bswapl %0":"=r"(r):"0"(r)); \
161 | *((unsigned int *)(c))=r; (c)+=4; r; })
162 | # endif
163 | # endif
164 | # endif
165 | #endif
166 | #if defined(__s390__) || defined(__s390x__)
167 | # define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l))
168 | # define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
169 | #endif
170 |
171 | #ifndef HOST_c2l
172 | #define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \
173 | l|=(((unsigned long)(*((c)++)))<<16), \
174 | l|=(((unsigned long)(*((c)++)))<< 8), \
175 | l|=(((unsigned long)(*((c)++))) ), \
176 | l)
177 | #endif
178 | #ifndef HOST_l2c
179 | #define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
180 | *((c)++)=(unsigned char)(((l)>>16)&0xff), \
181 | *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
182 | *((c)++)=(unsigned char)(((l) )&0xff), \
183 | l)
184 | #endif
185 |
186 | #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
187 |
188 | #ifndef PEDANTIC
189 | # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
190 | # if defined(__s390x__)
191 | # define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \
192 | :"=d"(l) :"m"(*(const unsigned int *)(c)));\
193 | (c)+=4; (l); })
194 | # define HOST_l2c(l,c) ({ asm ("strv %1,%0" \
195 | :"=m"(*(unsigned int *)(c)) :"d"(l));\
196 | (c)+=4; (l); })
197 | # endif
198 | # endif
199 | #endif
200 | #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
201 | # ifndef B_ENDIAN
202 | /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
203 | # define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l)
204 | # define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l)
205 | # endif
206 | #endif
207 |
208 | #ifndef HOST_c2l
209 | #define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \
210 | l|=(((unsigned long)(*((c)++)))<< 8), \
211 | l|=(((unsigned long)(*((c)++)))<<16), \
212 | l|=(((unsigned long)(*((c)++)))<<24), \
213 | l)
214 | #endif
215 | #ifndef HOST_l2c
216 | #define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
217 | *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
218 | *((c)++)=(unsigned char)(((l)>>16)&0xff), \
219 | *((c)++)=(unsigned char)(((l)>>24)&0xff), \
220 | l)
221 | #endif
222 |
223 | #endif
224 |
225 | /*
226 | * Time for some action:-)
227 | */
228 | static
229 | int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len)
230 | {
231 | const unsigned char *data=data_;
232 | unsigned char *p;
233 | HASH_LONG l;
234 | size_t n;
235 |
236 | if (len==0) return 1;
237 |
238 | l=(c->Nl+(((HASH_LONG)len)<<3))&0xffffffffUL;
239 | /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
240 | * Wei Dai for pointing it out. */
241 | if (l < c->Nl) /* overflow */
242 | c->Nh++;
243 | c->Nh+=(HASH_LONG)(len>>29); /* might cause compiler warning on 16-bit */
244 | c->Nl=l;
245 |
246 | n = c->num;
247 | if (n != 0)
248 | {
249 | p=(unsigned char *)c->data;
250 |
251 | if (len >= HASH_CBLOCK || len+n >= HASH_CBLOCK)
252 | {
253 | memcpy (p+n,data,HASH_CBLOCK-n);
254 | HASH_BLOCK_DATA_ORDER (c,p,1);
255 | n = HASH_CBLOCK-n;
256 | data += n;
257 | len -= n;
258 | c->num = 0;
259 | memset (p,0,HASH_CBLOCK); /* keep it zeroed */
260 | }
261 | else
262 | {
263 | memcpy (p+n,data,len);
264 | c->num += (unsigned int)len;
265 | return 1;
266 | }
267 | }
268 |
269 | n = len/HASH_CBLOCK;
270 | if (n > 0)
271 | {
272 | HASH_BLOCK_DATA_ORDER (c,data,n);
273 | n *= HASH_CBLOCK;
274 | data += n;
275 | len -= n;
276 | }
277 |
278 | if (len != 0)
279 | {
280 | p = (unsigned char *)c->data;
281 | c->num = (unsigned int)len;
282 | memcpy (p,data,len);
283 | }
284 | return 1;
285 | }
286 |
287 | static
288 | void HASH_TRANSFORM (HASH_CTX *c, const unsigned char *data)
289 | {
290 | HASH_BLOCK_DATA_ORDER (c,data,1);
291 | }
292 |
293 | static
294 | int HASH_FINAL (unsigned char *md, HASH_CTX *c)
295 | {
296 | unsigned char *p = (unsigned char *)c->data;
297 | size_t n = c->num;
298 |
299 | p[n] = 0x80; /* there is always room for one */
300 | n++;
301 |
302 | if (n > (HASH_CBLOCK-8))
303 | {
304 | memset (p+n,0,HASH_CBLOCK-n);
305 | n=0;
306 | HASH_BLOCK_DATA_ORDER (c,p,1);
307 | }
308 | memset (p+n,0,HASH_CBLOCK-8-n);
309 |
310 | p += HASH_CBLOCK-8;
311 | #if defined(DATA_ORDER_IS_BIG_ENDIAN)
312 | (void)HOST_l2c(c->Nh,p);
313 | (void)HOST_l2c(c->Nl,p);
314 | #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
315 | (void)HOST_l2c(c->Nl,p);
316 | (void)HOST_l2c(c->Nh,p);
317 | #endif
318 | p -= HASH_CBLOCK;
319 | HASH_BLOCK_DATA_ORDER (c,p,1);
320 | c->num=0;
321 | memset (p,0,HASH_CBLOCK);
322 |
323 | HASH_MAKE_STRING(c,md);
324 |
325 | return 1;
326 | }
327 |
328 | static
329 | void HASH_MAKE_STRING (HASH_CTX *c, unsigned char *s)
330 | {
331 | unsigned long ll;
332 | ll=c->A;
333 | (void)HOST_l2c(ll,s);
334 | ll=c->B;
335 | (void)HOST_l2c(ll,s);
336 | ll=c->C;
337 | (void)HOST_l2c(ll,s);
338 | ll=c->D;
339 | (void)HOST_l2c(ll,s);
340 | return;
341 | }
342 |
343 | static void md5_block_data_order (MD5_CTX *c, const void *p,size_t num);
344 | static
345 | void HASH_BLOCK_DATA_ORDER (MD5_CTX *c, const void *p, size_t num)
346 | {
347 | md5_block_data_order (c, p, num);
348 | return;
349 | }
350 |
351 | #ifndef MD32_REG_T
352 | #if defined(__alpha) || defined(__sparcv9) || defined(__mips)
353 | #define MD32_REG_T long
354 | /*
355 | * This comment was originaly written for MD5, which is why it
356 | * discusses A-D. But it basically applies to all 32-bit digests,
357 | * which is why it was moved to common header file.
358 | *
359 | * In case you wonder why A-D are declared as long and not
360 | * as MD5_LONG. Doing so results in slight performance
361 | * boost on LP64 architectures. The catch is we don't
362 | * really care if 32 MSBs of a 64-bit register get polluted
363 | * with eventual overflows as we *save* only 32 LSBs in
364 | * *either* case. Now declaring 'em long excuses the compiler
365 | * from keeping 32 MSBs zeroed resulting in 13% performance
366 | * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
367 | * Well, to be honest it should say that this *prevents*
368 | * performance degradation.
369 | *
370 | */
371 | #else
372 | /*
373 | * Above is not absolute and there are LP64 compilers that
374 | * generate better code if MD32_REG_T is defined int. The above
375 | * pre-processor condition reflects the circumstances under which
376 | * the conclusion was made and is subject to further extension.
377 | *
378 | */
379 | #define MD32_REG_T int
380 | #endif
381 | #endif
382 | //end md32_common.h
383 |
384 | /*
385 | #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
386 | #define G(x,y,z) (((x) & (z)) | ((y) & (~(z))))
387 | */
388 |
389 | /* As pointed out by Wei Dai , the above can be
390 | * simplified to the code below. Wei attributes these optimizations
391 | * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
392 | */
393 | #define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))
394 | #define G(b,c,d) ((((b) ^ (c)) & (d)) ^ (c))
395 | #define H(b,c,d) ((b) ^ (c) ^ (d))
396 | #define I(b,c,d) (((~(d)) | (b)) ^ (c))
397 |
398 | #define R0(a,b,c,d,k,s,t) { \
399 | a+=((k)+(t)+F((b),(c),(d))); \
400 | a=ROTATE(a,s); \
401 | a+=b; };\
402 |
403 | #define R1(a,b,c,d,k,s,t) { \
404 | a+=((k)+(t)+G((b),(c),(d))); \
405 | a=ROTATE(a,s); \
406 | a+=b; };
407 |
408 | #define R2(a,b,c,d,k,s,t) { \
409 | a+=((k)+(t)+H((b),(c),(d))); \
410 | a=ROTATE(a,s); \
411 | a+=b; };
412 |
413 | #define R3(a,b,c,d,k,s,t) { \
414 | a+=((k)+(t)+I((b),(c),(d))); \
415 | a=ROTATE(a,s); \
416 | a+=b; };
417 |
418 | const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT;
419 |
420 | /* Implemented from RFC1321 The MD5 Message-Digest Algorithm
421 | */
422 |
423 | #define INIT_DATA_A (unsigned long)0x67452301L
424 | #define INIT_DATA_B (unsigned long)0xefcdab89L
425 | #define INIT_DATA_C (unsigned long)0x98badcfeL
426 | #define INIT_DATA_D (unsigned long)0x10325476L
427 |
428 | int MD5_Init(MD5_CTX *c)
429 | {
430 | memset (c,0,sizeof(*c));
431 | c->A=INIT_DATA_A;
432 | c->B=INIT_DATA_B;
433 | c->C=INIT_DATA_C;
434 | c->D=INIT_DATA_D;
435 | return 1;
436 | }
437 |
438 | #if !defined(MD5_ASM)
439 | #ifdef X
440 | #undef X
441 | #endif
442 | static
443 | void md5_block_data_order (MD5_CTX *c, const void *data_, size_t num)
444 | {
445 | const unsigned char *data=data_;
446 | register unsigned MD32_REG_T A,B,C,D,l;
447 | #ifndef MD32_XARRAY
448 | /* See comment in crypto/sha/sha_locl.h for details. */
449 | unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
450 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
451 | # define X(i) XX##i
452 | #else
453 | MD5_LONG XX[MD5_LBLOCK];
454 | # define X(i) XX[i]
455 | #endif
456 |
457 | A=c->A;
458 | B=c->B;
459 | C=c->C;
460 | D=c->D;
461 |
462 | for (;num--;)
463 | {
464 | HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l;
465 | /* Round 0 */
466 | R0(A,B,C,D,X( 0), 7,0xd76aa478L); HOST_c2l(data,l); X( 2)=l;
467 | R0(D,A,B,C,X( 1),12,0xe8c7b756L); HOST_c2l(data,l); X( 3)=l;
468 | R0(C,D,A,B,X( 2),17,0x242070dbL); HOST_c2l(data,l); X( 4)=l;
469 | R0(B,C,D,A,X( 3),22,0xc1bdceeeL); HOST_c2l(data,l); X( 5)=l;
470 | R0(A,B,C,D,X( 4), 7,0xf57c0fafL); HOST_c2l(data,l); X( 6)=l;
471 | R0(D,A,B,C,X( 5),12,0x4787c62aL); HOST_c2l(data,l); X( 7)=l;
472 | R0(C,D,A,B,X( 6),17,0xa8304613L); HOST_c2l(data,l); X( 8)=l;
473 | R0(B,C,D,A,X( 7),22,0xfd469501L); HOST_c2l(data,l); X( 9)=l;
474 | R0(A,B,C,D,X( 8), 7,0x698098d8L); HOST_c2l(data,l); X(10)=l;
475 | R0(D,A,B,C,X( 9),12,0x8b44f7afL); HOST_c2l(data,l); X(11)=l;
476 | R0(C,D,A,B,X(10),17,0xffff5bb1L); HOST_c2l(data,l); X(12)=l;
477 | R0(B,C,D,A,X(11),22,0x895cd7beL); HOST_c2l(data,l); X(13)=l;
478 | R0(A,B,C,D,X(12), 7,0x6b901122L); HOST_c2l(data,l); X(14)=l;
479 | R0(D,A,B,C,X(13),12,0xfd987193L); HOST_c2l(data,l); X(15)=l;
480 | R0(C,D,A,B,X(14),17,0xa679438eL);
481 | R0(B,C,D,A,X(15),22,0x49b40821L);
482 | /* Round 1 */
483 | R1(A,B,C,D,X( 1), 5,0xf61e2562L);
484 | R1(D,A,B,C,X( 6), 9,0xc040b340L);
485 | R1(C,D,A,B,X(11),14,0x265e5a51L);
486 | R1(B,C,D,A,X( 0),20,0xe9b6c7aaL);
487 | R1(A,B,C,D,X( 5), 5,0xd62f105dL);
488 | R1(D,A,B,C,X(10), 9,0x02441453L);
489 | R1(C,D,A,B,X(15),14,0xd8a1e681L);
490 | R1(B,C,D,A,X( 4),20,0xe7d3fbc8L);
491 | R1(A,B,C,D,X( 9), 5,0x21e1cde6L);
492 | R1(D,A,B,C,X(14), 9,0xc33707d6L);
493 | R1(C,D,A,B,X( 3),14,0xf4d50d87L);
494 | R1(B,C,D,A,X( 8),20,0x455a14edL);
495 | R1(A,B,C,D,X(13), 5,0xa9e3e905L);
496 | R1(D,A,B,C,X( 2), 9,0xfcefa3f8L);
497 | R1(C,D,A,B,X( 7),14,0x676f02d9L);
498 | R1(B,C,D,A,X(12),20,0x8d2a4c8aL);
499 | /* Round 2 */
500 | R2(A,B,C,D,X( 5), 4,0xfffa3942L);
501 | R2(D,A,B,C,X( 8),11,0x8771f681L);
502 | R2(C,D,A,B,X(11),16,0x6d9d6122L);
503 | R2(B,C,D,A,X(14),23,0xfde5380cL);
504 | R2(A,B,C,D,X( 1), 4,0xa4beea44L);
505 | R2(D,A,B,C,X( 4),11,0x4bdecfa9L);
506 | R2(C,D,A,B,X( 7),16,0xf6bb4b60L);
507 | R2(B,C,D,A,X(10),23,0xbebfbc70L);
508 | R2(A,B,C,D,X(13), 4,0x289b7ec6L);
509 | R2(D,A,B,C,X( 0),11,0xeaa127faL);
510 | R2(C,D,A,B,X( 3),16,0xd4ef3085L);
511 | R2(B,C,D,A,X( 6),23,0x04881d05L);
512 | R2(A,B,C,D,X( 9), 4,0xd9d4d039L);
513 | R2(D,A,B,C,X(12),11,0xe6db99e5L);
514 | R2(C,D,A,B,X(15),16,0x1fa27cf8L);
515 | R2(B,C,D,A,X( 2),23,0xc4ac5665L);
516 | /* Round 3 */
517 | R3(A,B,C,D,X( 0), 6,0xf4292244L);
518 | R3(D,A,B,C,X( 7),10,0x432aff97L);
519 | R3(C,D,A,B,X(14),15,0xab9423a7L);
520 | R3(B,C,D,A,X( 5),21,0xfc93a039L);
521 | R3(A,B,C,D,X(12), 6,0x655b59c3L);
522 | R3(D,A,B,C,X( 3),10,0x8f0ccc92L);
523 | R3(C,D,A,B,X(10),15,0xffeff47dL);
524 | R3(B,C,D,A,X( 1),21,0x85845dd1L);
525 | R3(A,B,C,D,X( 8), 6,0x6fa87e4fL);
526 | R3(D,A,B,C,X(15),10,0xfe2ce6e0L);
527 | R3(C,D,A,B,X( 6),15,0xa3014314L);
528 | R3(B,C,D,A,X(13),21,0x4e0811a1L);
529 | R3(A,B,C,D,X( 4), 6,0xf7537e82L);
530 | R3(D,A,B,C,X(11),10,0xbd3af235L);
531 | R3(C,D,A,B,X( 2),15,0x2ad7d2bbL);
532 | R3(B,C,D,A,X( 9),21,0xeb86d391L);
533 |
534 | A = c->A += A;
535 | B = c->B += B;
536 | C = c->C += C;
537 | D = c->D += D;
538 | }
539 | }
540 | #endif /* !defined(MD5_ASM) */
541 |
542 | #if defined(MD5_ASM)
543 | #error "TODO: The MD5_ASM code for x86 will be ported in njit-client sooner or later"
544 | # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || \
545 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) || \
546 | defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
547 | static
548 | void md5_block_data_order (MD5_CTX *c, const void *p,size_t num)
549 | {
550 | md5_block_asm_data_order(c, p, num);
551 | return;
552 | }
553 | # else
554 | # error "md5_block_asm_data_order() has not been supported on your platform"
555 | # endif
556 | #endif /* defined(MD5_ASM) */
557 |
558 | int MD5_Update (HASH_CTX *c, const void *data, size_t len)
559 | {
560 | return HASH_UPDATE (c, data, len);
561 | }
562 |
563 | void MD5_Transform (HASH_CTX *c, const unsigned char *data)
564 | {
565 | HASH_TRANSFORM (c, data);
566 | return;
567 | }
568 |
569 | int MD5_Final (unsigned char *md, HASH_CTX *c)
570 | {
571 | return HASH_FINAL (md, c);
572 | }
573 |
574 |
--------------------------------------------------------------------------------
/src/md5-buildin/md5_one.c:
--------------------------------------------------------------------------------
1 | /* crypto/md5/md5_one.c */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #include
60 | #include
61 | #include
62 | #include
63 |
64 | #ifdef CHARSET_EBCDIC
65 | #include
66 | #endif
67 |
68 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)
69 | {
70 | MD5_CTX c;
71 | static unsigned char m[MD5_DIGEST_LENGTH];
72 |
73 | if (md == NULL) md=m;
74 | if (!MD5_Init(&c))
75 | return NULL;
76 | #ifndef CHARSET_EBCDIC
77 | MD5_Update(&c,d,n);
78 | #else
79 | {
80 | char temp[1024];
81 | unsigned long chunk;
82 |
83 | while (n > 0)
84 | {
85 | chunk = (n > sizeof(temp)) ? sizeof(temp) : n;
86 | ebcdic2ascii(temp, d, chunk);
87 | MD5_Update(&c,temp,chunk);
88 | n -= chunk;
89 | d += chunk;
90 | }
91 | }
92 | #endif
93 | MD5_Final(md,&c);
94 | OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */
95 | return(md);
96 | }
97 |
98 |
--------------------------------------------------------------------------------
/src/md5-buildin/md5test.c:
--------------------------------------------------------------------------------
1 | /* crypto/md5/md5test.c */
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 | * All rights reserved.
4 | *
5 | * This package is an SSL implementation written
6 | * by Eric Young (eay@cryptsoft.com).
7 | * The implementation was written so as to conform with Netscapes SSL.
8 | *
9 | * This library is free for commercial and non-commercial use as long as
10 | * the following conditions are aheared to. The following conditions
11 | * apply to all code found in this distribution, be it the RC4, RSA,
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 | * included with this distribution is covered by the same copyright terms
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 | *
16 | * Copyright remains Eric Young's, and as such any Copyright notices in
17 | * the code are not to be removed.
18 | * If this package is used in a product, Eric Young should be given attribution
19 | * as the author of the parts of the library used.
20 | * This can be in the form of a textual message at program startup or
21 | * in documentation (online or textual) provided with the package.
22 | *
23 | * Redistribution and use in source and binary forms, with or without
24 | * modification, are permitted provided that the following conditions
25 | * are met:
26 | * 1. Redistributions of source code must retain the copyright
27 | * notice, this list of conditions and the following disclaimer.
28 | * 2. Redistributions in binary form must reproduce the above copyright
29 | * notice, this list of conditions and the following disclaimer in the
30 | * documentation and/or other materials provided with the distribution.
31 | * 3. All advertising materials mentioning features or use of this software
32 | * must display the following acknowledgement:
33 | * "This product includes cryptographic software written by
34 | * Eric Young (eay@cryptsoft.com)"
35 | * The word 'cryptographic' can be left out if the rouines from the library
36 | * being used are not cryptographic related :-).
37 | * 4. If you include any Windows specific code (or a derivative thereof) from
38 | * the apps directory (application code) you must include an acknowledgement:
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 | * SUCH DAMAGE.
52 | *
53 | * The licence and distribution terms for any publically available version or
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be
55 | * copied and put under another distribution licence
56 | * [including the GNU Public Licence.]
57 | */
58 |
59 | #include
60 | #include
61 | #include
62 |
63 | #include
64 | #include
65 |
66 | static char *test[]={
67 | "",
68 | "a",
69 | "abc",
70 | "message digest",
71 | "abcdefghijklmnopqrstuvwxyz",
72 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
73 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
74 | NULL,
75 | };
76 |
77 | static char *ret[]={
78 | "d41d8cd98f00b204e9800998ecf8427e",
79 | "0cc175b9c0f1b6a831c399e269772661",
80 | "900150983cd24fb0d6963f7d28e17f72",
81 | "f96b697d7cb7938d525a2f31aaf161d0",
82 | "c3fcd3d76192e4007dfb496cca67e13b",
83 | "d174ab98d277d9f5a5611c2c9f419d9f",
84 | "57edf4a22be3c955ac49da2e2107b67a",
85 | };
86 |
87 | static char *pt(unsigned char *md);
88 | int main(int argc, char *argv[])
89 | {
90 | int i,err=0;
91 | char **P,**R;
92 | char *p;
93 | unsigned char md[MD5_DIGEST_LENGTH];
94 |
95 | P=test;
96 | R=ret;
97 | i=1;
98 | while (*P != NULL)
99 | {
100 | MD5(&(P[0][0]),strlen((char *)*P),md);
101 | p=pt(md);
102 | if (strcmp(p,(char *)*R) != 0)
103 | {
104 | printf("error calculating MD5 on '%s'\n",*P);
105 | printf("got %s instead of %s\n",p,*R);
106 | err++;
107 | }
108 | else
109 | {
110 | printf("test %d ok\n",i);
111 | }
112 | i++;
113 | R++;
114 | P++;
115 | }
116 |
117 | if (err>=1)
118 | {
119 | printf("Total error: %d\n", err);
120 | exit(err);
121 | }
122 | return(0);
123 | }
124 |
125 | static char *pt(unsigned char *md)
126 | {
127 | int i;
128 | static char buf[80];
129 |
130 | for (i=0; i
60 | #include
61 |
62 | unsigned char cleanse_ctr = 0;
63 |
64 | void OPENSSL_cleanse(void *ptr, size_t len)
65 | {
66 | unsigned char *p = ptr;
67 | size_t loop = len, ctr = cleanse_ctr;
68 | while(loop--)
69 | {
70 | *(p++) = (unsigned char)ctr;
71 | ctr += (17 + ((size_t)p & 0xF));
72 | }
73 | p=memchr(ptr, (unsigned char)ctr, len);
74 | if(p)
75 | ctr += (63 + (size_t)p);
76 | cleanse_ctr = (unsigned char)ctr;
77 | }
78 |
--------------------------------------------------------------------------------
/src/njit8021xclient.c:
--------------------------------------------------------------------------------
1 | #if HAVE_CONFIG_H
2 | #include "config.h"
3 | #endif
4 |
5 | #ifndef PACKAGE_NAME
6 | #define PACKAGE_NAME ""
7 | #endif
8 |
9 | #ifndef PACKAGE_VERSION
10 | #define PACKAGE_VERSION ""
11 | #endif
12 |
13 | #ifndef LOCALEDIR
14 | #define LOCALEDIR "/usr/local/share/locale"
15 | #endif
16 |
17 | #include "njit8021xclient.h"
18 |
19 | const struct GlobalConfig g_config = {
20 | .package_name = PACKAGE_NAME,
21 | .package_version = PACKAGE_VERSION,
22 | .locale_dir = LOCALEDIR,
23 | };
24 |
25 |
--------------------------------------------------------------------------------
/src/njit8021xclient.h:
--------------------------------------------------------------------------------
1 | #ifndef NJIT8021XCLIENT_H
2 | #define NJIT8021XCLIENT_H
3 |
4 | extern const struct GlobalConfig {
5 | const char *package_name;
6 | const char *package_version;
7 | const char *locale_dir;
8 | } g_config;
9 |
10 | #endif//NJIT8021XCLIENT_H
11 |
--------------------------------------------------------------------------------