!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/drivers/net/   drwxr-xr-x
Free 318.34 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     pppox.c (3.23 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/** -*- linux-c -*- ***********************************************************
 * Linux PPP over X/Ethernet (PPPoX/PPPoE) Sockets
 *
 * PPPoX --- Generic PPP encapsulation socket family
 * PPPoE --- PPP over Ethernet (RFC 2516)
 *
 *
 * Version:    0.5.1
 *
 * Author:    Michal Ostrowski <mostrows@styx.uwaterloo.ca>
 *
 * 051000 :    Initialization cleanup
 *
 * License:
 *        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.
 *
 */

#include <linux/string.h>
#include <linux/module.h>

#include <asm/uaccess.h>

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>

#include <linux/netdevice.h>
#include <linux/net.h>
#include <linux/init.h>
#include <linux/if_pppox.h>
#include <net/sock.h>
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#include <linux/ppp_channel.h>

static struct pppox_proto *proto[PX_MAX_PROTO+1];

int register_pppox_proto(int proto_num, struct pppox_proto *pp)
{
    if (proto_num < 0 || proto_num > PX_MAX_PROTO) {
        return -EINVAL;
    }

    if (proto[proto_num])
        return -EALREADY;

    MOD_INC_USE_COUNT;

    proto[proto_num] = pp;
    return 0;
}

void unregister_pppox_proto(int proto_num)
{
    if (proto_num >= 0 && proto_num <= PX_MAX_PROTO) {
        proto[proto_num] = NULL;
        MOD_DEC_USE_COUNT;
    }
}

void pppox_unbind_sock(struct sock *sk)
{
    /* Clear connection to ppp device, if attached. */

    if (sk->state & PPPOX_BOUND) {
        ppp_unregister_channel(&sk->protinfo.pppox->chan);
        sk->state &= ~PPPOX_BOUND;
    }
}

EXPORT_SYMBOL(register_pppox_proto);
EXPORT_SYMBOL(unregister_pppox_proto);
EXPORT_SYMBOL(pppox_unbind_sock);

static int pppox_ioctl(struct socket* sock, unsigned int cmd,
               unsigned long arg)
{
    struct sock *sk = sock->sk;
    struct pppox_opt *po;
    int err = 0;

    po = sk->protinfo.pppox;

    lock_sock(sk);

    switch (cmd) {
    case PPPIOCGCHAN:{
        int index;
        err = -ENOTCONN;
        if (!(sk->state & PPPOX_CONNECTED))
            break;

        err = -EINVAL;
        index = ppp_channel_index(&po->chan);
        if (put_user(index , (int *) arg))
            break;

        err = 0;
        sk->state |= PPPOX_BOUND;
        break;
    }
    default:
        if (proto[sk->protocol]->ioctl)
            err = (*proto[sk->protocol]->ioctl)(sock, cmd, arg);

        break;
    };

    release_sock(sk);
    return err;
}


static int pppox_create(struct socket *sock, int protocol)
{
    int err = 0;

    if (protocol < 0 || protocol > PX_MAX_PROTO)
        return -EPROTOTYPE;

    if (proto[protocol] == NULL)
        return -EPROTONOSUPPORT;

    err = (*proto[protocol]->create)(sock);

    if (err == 0) {
        /* We get to set the ioctl handler. */
        /* For everything else, pppox is just a shell. */
        sock->ops->ioctl = pppox_ioctl;
    }

    return err;
}

static struct net_proto_family pppox_proto_family = {
    PF_PPPOX,
    pppox_create
};

static int __init pppox_init(void)
{
    int err = 0;

    err = sock_register(&pppox_proto_family);

    return err;
}

static void __exit pppox_exit(void)
{
    sock_unregister(PF_PPPOX);
}

module_init(pppox_init);
module_exit(pppox_exit);

MODULE_AUTHOR("Michal Ostrowski <mostrows@speakeasy.net>");
MODULE_DESCRIPTION("PPP over Ethernet driver (generic socket layer)");
MODULE_LICENSE("GPL");

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0047 ]--