红联Linux门户
Linux帮助

ubuntu7.10下make的问题,求救!

发布时间:2007-10-20 16:27:59来源:红联作者:bslt
今天下完ubuntu7.10之后,因为学校需要dr.com(v3.39)在win下登陆上网,于是按照论坛里的帖子,下了drcom-1.3.7.tar.gz,编译的时候出些下面的代码,请高手们多多指教!
root@blackstar:/tmp/drcom-1.3.7# make
make -C drcomc
make[1]: Entering directory `/tmp/drcom-1.3.7/drcomc'
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o drcomc.o drcomc.c
gcc drcomc.o -o drcomc
make[1]: Leaving directory `/tmp/drcom-1.3.7/drcomc'
make -C drcomd
make[1]: Entering directory `/tmp/drcom-1.3.7/drcomd'
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o drcomd.o drcomd.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o daemon.o daemon.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o cleanup.o cleanup.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o dialog.o dialog.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o handle.o handle.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o init.o init.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o keepalive.o keepalive.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o login.o login.c
login.c: In function ‘drcom_login’:
login.c:50: warning: unused parameter ‘timeout’
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o logout.o logout.c
logout.c: In function ‘drcom_logout’:
logout.c:34: warning: unused parameter ‘timeout’
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o md5.o md5.c
md5.c:131:36: warning: use of C99 long long integer constant
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o misc.o misc.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o passwd.o passwd.c
passwd.c: In function ‘drcom_passwd’:
passwd.c:32: warning: unused parameter ‘timeout’
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o readconf.o readconf.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o watchport.o watchport.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o getaddr.o getaddr.c
gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes -pedantic -I/tmp/drcom-1.3.7/include -O2 -c -o log.o log.c
log.c: In function ‘dbg’:
log.c:34: warning: unused parameter ‘format’
gcc -lm -lpthread drcomd.o daemon.o cleanup.o dialog.o handle.o init.okeepalive.o login.o logout.o md5.o misc.o passwd.o readconf.owatchport.o getaddr.o log.o -o drcomd
make[1]: Leaving directory `/tmp/drcom-1.3.7/drcomd'
make -C kmod
make[1]: Entering directory `/tmp/drcom-1.3.7/kmod'
make -C /lib/modules/2.6.22-14-generic/build M=/tmp/drcom-1.3.7/kmod modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.22-14-generic'
CC [M] /tmp/drcom-1.3.7/kmod/init.o
CC [M] /tmp/drcom-1.3.7/kmod/proc.o
CC [M] /tmp/drcom-1.3.7/kmod/proto.o
/tmp/drcom-1.3.7/kmod/proto.c: In function ‘init_hijack’:
/tmp/drcom-1.3.7/kmod/proto.c:453: warning: assignment from incompatible pointer type
/tmp/drcom-1.3.7/kmod/proto.c:454: warning: assignment from incompatible pointer type
/tmp/drcom-1.3.7/kmod/proto.c: In function ‘cleanup_hijack’:
/tmp/drcom-1.3.7/kmod/proto.c:461: warning: comparison of distinct pointer types lacks a cast
/tmp/drcom-1.3.7/kmod/proto.c:462: warning: assignment from incompatible pointer type
LD [M] /tmp/drcom-1.3.7/kmod/drcom.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/drcom-1.3.7/kmod/drcom.mod.o
LD [M] /tmp/drcom-1.3.7/kmod/drcom.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.22-14-generic'
make[1]: Leaving directory `/tmp/drcom-1.3.7/kmod'

我的内核信息:
root@blackstar:~# uname -r
2.6.22-14-generic

root@blackstar:~# ls /usr/src
linux-headers-2.6.22-14 linux-headers-2.6.22-14-generic

gcc的版本:
root@blackstar:~# cat /proc/version
Linux version 2.6.22-14-generic (buildd@palmer) (gcc version 4.1.320070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Sun Oct 1423:05:12 GMT 2007

请各位高手们指点,被dr.com折磨很长时间了,痛苦啊......

[ 本帖最后由 bslt 于 2007-10-20 16:42 编辑 ]
文章评论

共有 6 条评论

  1. bslt 于 2007-10-20 17:03:02发表:

    谢谢版主,我再试试!

  2. gxf 于 2007-10-20 16:54:52发表:

    上面的信息只有warning ,make之后接着make install ,make clean

  3. bslt 于 2007-10-20 16:48:20发表:

    不是错误信息吗?版主,我第一次装linux,就出现这个问题,不是很明白了,谢谢版主,请多多指教!!!

  4. gxf 于 2007-10-20 16:45:24发表:

    都是些警告信息,错误信息在哪

  5. bslt 于 2007-10-20 16:29:59发表:

    这是drcom-1.3.7的login.c代码:
    /*
    libdrcom - Library for communicating with DrCOM 2133 Broadband Access Server
    Copyright (C) 2005 William Poetra Yoga Hadisoeseno <williampoetra@yahoo.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */

    #include
    #include

    #include "md5.h"

    #include "log.h"

    #include "private.h"

    void _build_login_packet(struct drcom_login_packet *, struct drcom_info *, struct drcom_host *, struct drcom_challenge *);
    void _build_authentication(struct drcom_auth *, struct drcom_acknowledgement *);
    void _build_keepalive(struct drcom_host_msg *, struct drcom_login_packet *, struct drcom_acknowledgement *);
    /*
    static void mylog_message(int priority, const char *format, va_list args)
    {
    vfprintf(stderr, format, args);
    }

    void myloginfo(const char *format, ...)
    {
    va_list args;
    va_start(args, format);
    mylog_message(LOG_INFO, format, args);
    va_end(args);
    }
    */
    /* drcom_login
    Logs in.
    */

    int drcom_login(struct drcom_handle *h, int timeout)
    {
    struct drcom_socks *socks = (struct drcom_socks *) h->socks;
    struct drcom_info *info = (struct drcom_info *) h->info;
    struct drcom_host *host = (struct drcom_host *) h->host;
    struct drcom_host_msg *response = (struct drcom_host_msg *) h->response;
    struct drcom_host_msg *keepalive = (struct drcom_host_msg *) h->keepalive;
    struct drcom_auth *auth = (struct drcom_auth *) h->auth;
    struct drcom_challenge challenge;
    struct drcom_login_packet login_packet;
    struct drcom_acknowledgement acknowledgement;
    int retry=0;

    try_it_again_1:
    retry++;
    if(retry>3)
    return -1;
    if(_send_dialog_packet(socks, NULL, PKT_REQUEST)<0){
    logerr("_send_dialog_packet(PKT_REQUEST) failed\n");
    return -1;
    }

    if(_recv_dialog_packet(socks, &challenge, PKT_CHALLENGE)<0){
    logerr("_recv_dialog_packet(PKT_CHALLENGE) failed\n");
    goto try_it_again_1;
    }

    /* Now the _real_ ip address of the server is known */
    info->servip = socks->servaddr_in.sin_addr.s_addr;

    _build_login_packet(&login_packet, info, host, &challenge);

    retry=0;
    try_it_again_2:
    retry++;
    if(retry>3)
    return -1;
    if(_send_dialog_packet(socks, &login_packet, PKT_LOGIN)<0){
    logerr("_send_dialog_packet(PKT_LOGIN) failed\n");
    return -1;
    }

    if(_recv_dialog_packet(socks, &acknowledgement, PKT_ACK_SUCCESS)<0){
    logerr("_recv_dialog_packet(PKT_ACK_SUCCESS) failed\n");
    goto try_it_again_2;
    }

    if (acknowledgement.serv_header.pkt_type == PKT_ACK_SUCCESS)
    {
    _build_authentication(auth, &acknowledgement);
    _build_keepalive(keepalive, &login_packet, &acknowledgement);
    memcpy(response, keepalive, sizeof(*keepalive));
    loginfo("You have used %u Minutes, and %uK bytes\n",
    acknowledgement.time_usage, acknowledgement.vol_usage);
    return 0;
    }
    else
    return -1;
    }

    void _build_login_packet(struct drcom_login_packet *login_packet,
    struct drcom_info *info, struct drcom_host *host,
    struct drcom_challenge *challenge)
    {
    char s[25];
    unsigned char t[22], d[16];
    int i, passwd_len;

    /* header */
    login_packet->host_header.pkt_type = PKT_LOGIN;
    login_packet->host_header.zero = 0;
    login_packet->host_header.len = strlen(info->username) +
    sizeof(struct drcom_host_header);
    memset(t, 0, 22);
    memcpy(t, &login_packet->host_header.pkt_type, 2);
    memcpy(t + 2, &challenge->challenge, 4);
    passwd_len = strlen(info->password);
    strncpy((char *) (t + 6), info->password, 16);
    MD5((unsigned char *) t, passwd_len + 6, d);
    memcpy(login_packet->host_header.checksum, d, 16);

    /* username */
    memset(login_packet->username, 0, 36);
    strncpy(login_packet->username, info->username, 36);

    /* unknown, maybe just a signature? */
    login_packet->unknown0 = 0x18;

    /* mac */
    login_packet->mac_code = 1;
    memcpy(login_packet->mac_xor, info->mac, 6);
    for (i = 0; i < 6; ++i)
    login_packet->mac_xor[i] ^= login_packet->host_header.checksum[i];

    /* ok, first checksum */
    /* l already calculated */
    /* l = strlen(info->password); */
    s[0] = 0x01;
    memcpy(s + 1, info->password, passwd_len);
    memcpy(s + 1 + passwd_len, &challenge->challenge, 4);
    memset(s + 1 + passwd_len + 4, 0, 4);
    MD5((unsigned char *) s, 1 + passwd_len + 4 + 4, d);
    memcpy(login_packet->checksum1, d, 16);

    /* nic */
    login_packet->num_nic = 1;
    memcpy(login_packet->nic, info->nic, 16);

    /* second checksum */
    login_packet->checksum2_half[0] = 0x14;
    login_packet->checksum2_half[1] = 0x00;
    login_packet->checksum2_half[2] = 0x07;
    login_packet->checksum2_half[3] = 0x0b;
    MD5((unsigned char *) login_packet, 0x65, d);
    memcpy(login_packet->checksum2_half, d, 8);

    /* we've got a dog */
    login_packet->dog = 1;

    /* host info */
    memset(login_packet->zero1, 0, 4);
    memcpy(&login_packet->host_info, host, sizeof(struct drcom_host));
    memset(login_packet->zero2, 0, 96);

    /* wtf? */
    login_packet->unknown1 = 0x01;
    login_packet->unknown2 = 0x00;
    login_packet->unknown3[0] = 0x01;
    login_packet->unknown3[1] = 0x08;

    /* maybe we should use something random instead? */
    /*
    memset(login_packet->unknown4, 0, 8);
    */
    login_packet->unknown4[0] = 0x00;
    login_packet->unknown4[1] = 0xf0;
    login_packet->unknown4[2] = 0x66;
    login_packet->unknown4[3] = 0x33;
    login_packet->unknown4[4] = 0x72;
    login_packet->unknown4[5] = 0x5b;
    login_packet->unknown4[6] = 0xc4;
    login_packet->unknown4[7] = 0x01;
    /*
    memcpy(login_packet->unknown4, d + 8, 8);
    */

    return;
    }

    void _build_authentication(struct drcom_auth *auth, struct drcom_acknowledgement *acknowledgement)
    {
    memcpy(auth, &acknowledgement->auth_info, sizeof(struct drcom_auth));
    return;
    }

    void _build_keepalive(struct drcom_host_msg *keepalive, struct drcom_login_packet *login_packet, struct drcom_acknowledgement *acknowledgement)
    {
    keepalive->msgtype = 0xff;
    memset(keepalive->msg, 0, 19);
    memcpy(keepalive->msg, login_packet->host_header.checksum, 16);
    memcpy(&keepalive->auth_info, &acknowledgement->auth_info, sizeof(struct drcom_auth));
    return;
    }

  6. bslt 于 2007-10-20 16:28:32发表:

    是gcc版本的事吗?