📄 main.lst
字号:
C51 COMPILER V7.07 MAIN 06/25/2004 10:50:46 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN c:\keil\projects\libraries_samples\pop3\main.obj
COMPILER INVOKED BY: c:\keil\C51\bin\C51.EXE c:\keil\projects\libraries_samples\pop3\main.c LARGE OMF2 ROM(D16M) OPTIMIZ
-E(9,SPEED) BROWSE NOINTVECTOR MODDP2 MODDA VARBANKING DEBUG INCDIR(C:\Keil\C51\INC\Dallas;c:\keil\projects\libraries_sam
-ples\pop3) OBJECT(c:\keil\projects\libraries_samples\pop3\main.obj)
stmt level source
1 /* ---------------------------------------------------------------------------
2 * Copyright (C) 2003 Dallas Semiconductor Corporation, All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Except as contained in this notice, the name of Dallas Semiconductor
23 * shall not be used except as stated in the Dallas Semiconductor
24 * Branding Policy.
25 * ---------------------------------------------------------------------------
26 */
27
28 /***************************************************************************************
29 * Module Name : TINI Mail Client Library Test Application
30 * Description : This application demonstrates pop3 library functionality
31 * Filename : main.c
32 * Compiler : keil C51 Compiler V7.06
33 * Version : Version 1.0
34 * Created :
35 *Modifications :
36 * Notes :
37 *************************************************************************************/
38
39 //include files
40 #include <reg400.h>
41 #include <rom400_init.h>
42 #include <rom400_task.h>
43 #include <rom400_sock.h>
44 #include <rom400_kmem.h>
45 #include <rom400_mem.h>
46 #include "tini400_pop3.h"
47 #include "stdio.h"
48 #include "tini400_mime.h"
49 #include "tini400_ntlm.h"
50 #include <string.h>
51
52 //leave 4000h bytes for function parameters
53 #define RAM_START 0x20000
C51 COMPILER V7.07 MAIN 06/25/2004 10:50:46 PAGE 2
54 #define RAM_END 0x5FFFF
55
56 #define FS_START 0x70000
57 #define FS_BLOCKS 256
58
59 //Static IP Address (used if you are selecting a static IP)
60 #define STATIC_IP_MSB 192
61 #define STATIC_IP_2 168
62 #define STATIC_IP_3 110
63 #define STATIC_IP_LSB 57
64
65 //Static Subnet Mask (used if you are selecting a static IP)
66 #define STATIC_SUBNETMASK_MSB 255
67 #define STATIC_SUBNETMASK_2 255
68 #define STATIC_SUBNETMASK_3 255
69 #define STATIC_SUBNETMASK_LSB 0
70
71 #define STATIC_IPV4_PREFIX 16
72
73 //Static Gateway (used if you are selecting a static IP)
74 #define STATIC_GATEWAY_MSB 180
75 #define STATIC_GATEWAY_2 0
76 #define STATIC_GATEWAY_3 110
77 #define STATIC_GATEWAY_LSB 24
78
79 //display mailnode object content
80 void print_mailnode(struct _mail *newmailnode);
81 void printfile(char *filename);
82
83 //function declaration for pop3 authentication call back
84 int ntlm_authentication(pop3_session *pop3_handle);
85
86 //variable declarations for handling ntlm messages
87 type1msg t1_msg;
88 type2msg t2_msg;
89 type3msg t3_msg;
90
91 /****************************************************************************************
92 * Function Name : do_static
93 * Description : configures IP address of TINI
94 * Input(s) : nothing
95 * Output(s) : nothing
96 * Destroyed :
97 * Notes :
98 *****************************************************************************************/
99 void do_static()
100 {
101 1 unsigned int result;
102 1 unsigned char xdata config[56];
103 1 unsigned int i;
104 1 for (i=0;i<56;i++)
105 1 config[i] = 0;
106 1
107 1 //set the ip address
108 1 config[12] = STATIC_IP_MSB;
109 1 config[13] = STATIC_IP_2;
110 1 config[14] = STATIC_IP_3;
111 1 config[15] = STATIC_IP_LSB;
112 1
113 1 //set the subnet mask
114 1 config[16] = STATIC_SUBNETMASK_MSB;
115 1 config[17] = STATIC_SUBNETMASK_2;
C51 COMPILER V7.07 MAIN 06/25/2004 10:50:46 PAGE 3
116 1 config[18] = STATIC_SUBNETMASK_3;
117 1 config[19] = STATIC_SUBNETMASK_LSB;
118 1
119 1 //set the iP4 prefix
120 1 config[20] = STATIC_IPV4_PREFIX;
121 1
122 1 //set the gateway
123 1 config[33] = STATIC_GATEWAY_MSB;
124 1 config[34] = STATIC_GATEWAY_2;
125 1 config[35] = STATIC_GATEWAY_3;
126 1 config[36] = STATIC_GATEWAY_LSB;
127 1
128 1 result = setnetworkparams(config);
129 1 }
130
131 //main entry point of application
132 void main()
133 {
134 1 int status, count;
135 1 unsigned int temp;
136 1 struct _mail *readmail;
137 1 struct _maillist *ml;
138 1
139 1 long pop3_ip;
140 1
141 1 //for file system.
142 1 FILE* file;
143 1 void* start;
144 1
145 1 //user header object
146 1 userheader u_hdr;
147 1 char user[30], pass[30];
148 1
149 1 //install updated network stack
150 1 xnetstack_install();
*** WARNING C206 IN LINE 150 OF C:\KEIL\PROJECTS\LIBRARIES_SAMPLES\POP3\MAIN.C: 'xnetstack_install': missing function-pr
-ototype
151 1
152 1 //install updated memory library
153 1 kmem_install(ROM400_KMEM_MODEL_SMALLEST + 2);
154 1
155 1 //initialize ROM
156 1 init_rom(RAM_START, RAM_END);
157 1
158 1 //initialize pop3 library
159 1 pop3_init();
160 1
161 1 clear_param_buffers();
162 1
163 1 //configure IP address
164 1 do_static();
165 1
166 1 start = (void*)FS_START;
*** WARNING C196 IN LINE 166 OF C:\KEIL\PROJECTS\LIBRARIES_SAMPLES\POP3\MAIN.C: mspace probably invalid
167 1 temp = finit(FOPEN_MAX, FS_BLOCKS, start);
168 1 printf("Result of FS init: %d \r\n", temp);
169 1
170 1 //pop3 server ip address
171 1 pop3_ip=inet_addr("192.168.110.38");
172 1
173 1 printf("\n Enter user name:");
174 1 scanf("%s",user);
C51 COMPILER V7.07 MAIN 06/25/2004 10:50:46 PAGE 4
175 1 printf("\n Enter password:");
176 1 scanf("%s",pass);
177 1
178 1 //login to pop3 server
179 1 status=pop3_login(pop3_ip,user,pass);
180 1 printf("\nthe return value of pop3_login is:%d",status);
181 1
182 1 //get mail box status
183 1 pop3_getmailboxstate(&status,&count);
*** WARNING C182 IN LINE 183 OF C:\KEIL\PROJECTS\LIBRARIES_SAMPLES\POP3\MAIN.C: pointer to different objects
184 1 printf("\nMAILBOX STATUS: Number of mails %d and size %d",status,count);
185 1
186 1 //read mail list and value
187 1 ml=pop3_getmaillist(&status);
188 1 if(ml!=0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -