···255255 xor 8(%ebp),%r4256256 xor 12(%ebp),%r5257257258258- sub $8,%esp // space for register saves on stack259259- add $16,%ebp // increment to next round key260260- sub $10,%r3 261261- je 4f // 10 rounds for 128-bit key262262- add $32,%ebp263263- sub $2,%r3264264- je 3f // 12 rounds for 128-bit key265265- add $32,%ebp258258+ sub $8,%esp // space for register saves on stack259259+ add $16,%ebp // increment to next round key260260+ cmp $12,%r3261261+ jb 4f // 10 rounds for 128-bit key262262+ lea 32(%ebp),%ebp263263+ je 3f // 12 rounds for 192-bit key264264+ lea 32(%ebp),%ebp266265267267-2: fwd_rnd1( -64(%ebp) ,ft_tab) // 14 rounds for 128-bit key266266+2: fwd_rnd1( -64(%ebp) ,ft_tab) // 14 rounds for 256-bit key268267 fwd_rnd2( -48(%ebp) ,ft_tab)269269-3: fwd_rnd1( -32(%ebp) ,ft_tab) // 12 rounds for 128-bit key268268+3: fwd_rnd1( -32(%ebp) ,ft_tab) // 12 rounds for 192-bit key270269 fwd_rnd2( -16(%ebp) ,ft_tab)2712704: fwd_rnd1( (%ebp) ,ft_tab) // 10 rounds for 128-bit key272271 fwd_rnd2( +16(%ebp) ,ft_tab)···333334 xor 8(%ebp),%r4334335 xor 12(%ebp),%r5335336336336- sub $8,%esp // space for register saves on stack337337- sub $16,%ebp // increment to next round key338338- sub $10,%r3 339339- je 4f // 10 rounds for 128-bit key340340- sub $32,%ebp341341- sub $2,%r3342342- je 3f // 12 rounds for 128-bit key343343- sub $32,%ebp337337+ sub $8,%esp // space for register saves on stack338338+ sub $16,%ebp // increment to next round key339339+ cmp $12,%r3340340+ jb 4f // 10 rounds for 128-bit key341341+ lea -32(%ebp),%ebp342342+ je 3f // 12 rounds for 192-bit key343343+ lea -32(%ebp),%ebp344344345345-2: inv_rnd1( +64(%ebp), it_tab) // 14 rounds for 128-bit key345345+2: inv_rnd1( +64(%ebp), it_tab) // 14 rounds for 256-bit key346346 inv_rnd2( +48(%ebp), it_tab)347347-3: inv_rnd1( +32(%ebp), it_tab) // 12 rounds for 128-bit key347347+3: inv_rnd1( +32(%ebp), it_tab) // 12 rounds for 192-bit key348348 inv_rnd2( +16(%ebp), it_tab)3493494: inv_rnd1( (%ebp), it_tab) // 10 rounds for 128-bit key350350 inv_rnd2( -16(%ebp), it_tab)
···22 * Cryptographic API.33 *44 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>55+ * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au>56 *67 * This program is free software; you can redistribute it and/or modify it78 * under the terms of the GNU General Public License as published by the Free···1716#include <linux/highmem.h>1817#include <linux/interrupt.h>1918#include <linux/init.h>1919+#include <linux/list.h>2020#include <linux/kernel.h>2121+#include <linux/rwsem.h>2122#include <linux/slab.h>2223#include <asm/kmap_types.h>2424+2525+extern struct list_head crypto_alg_list;2626+extern struct rw_semaphore crypto_alg_sem;23272428extern enum km_type crypto_km_types[];2529
···44 * Procfs information.55 *66 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>77+ * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au>78 *89 * This program is free software; you can redistribute it and/or modify it910 * under the terms of the GNU General Public License as published by the Free···1817#include <linux/proc_fs.h>1918#include <linux/seq_file.h>2019#include "internal.h"2121-2222-extern struct list_head crypto_alg_list;2323-extern struct rw_semaphore crypto_alg_sem;24202521static void *c_start(struct seq_file *m, loff_t *pos)2622{···5153 struct crypto_alg *alg = (struct crypto_alg *)p;52545355 seq_printf(m, "name : %s\n", alg->cra_name);5656+ seq_printf(m, "driver : %s\n", alg->cra_driver_name);5457 seq_printf(m, "module : %s\n", module_name(alg->cra_module));5858+ seq_printf(m, "priority : %d\n", alg->cra_priority);55595660 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) {5761 case CRYPTO_ALG_TYPE_CIPHER:
+2
crypto/serpent.c
···2020#include <linux/errno.h>2121#include <asm/byteorder.h>2222#include <linux/crypto.h>2323+#include <linux/types.h>23242425/* Key is padded to the maximum of 256 bits before round key generation.2526 * Any key length <= 256 bits (32 bytes) is allowed by the algorithm.···553552 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,554553 .cra_blocksize = SERPENT_BLOCK_SIZE,555554 .cra_ctxsize = sizeof(struct serpent_ctx),555555+ .cra_alignmask = 3,556556 .cra_module = THIS_MODULE,557557 .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list),558558 .cra_u = { .cipher = {
···17171818/* Control word. */1919struct cword {2020- int __attribute__ ((__packed__))2020+ unsigned int __attribute__ ((__packed__))2121 rounds:4,2222 algo:3,2323 keygen:1,
+13
drivers/net/Kconfig
···2727# that for each of the symbols.2828if NETDEVICES29293030+config IFB3131+ tristate "Intermediate Functional Block support"3232+ depends on NET_CLS_ACT3333+ ---help---3434+ This is an intermidiate driver that allows sharing of3535+ resources.3636+ To compile this driver as a module, choose M here: the module3737+ will be called ifb. If you want to use more than one ifb3838+ device at a time, you need to compile this driver as a module.3939+ Instead of 'ifb', the devices will then be called 'ifb0',4040+ 'ifb1' etc.4141+ Look at the iproute2 documentation directory for usage etc4242+3043config DUMMY3144 tristate "Dummy net driver support"3245 ---help---
···515515 count = kiss_esc(p, (unsigned char *)ax->xbuff, len);516516 }517517 }518518+ spin_unlock_bh(&ax->buflock);518519519520 set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);520521 actual = ax->tty->driver->write(ax->tty, ax->xbuff, count);···525524 ax->dev->trans_start = jiffies;526525 ax->xleft = count - actual;527526 ax->xhead = ax->xbuff + actual;528528- spin_unlock_bh(&ax->buflock);529527}530528531529/* Encapsulate an AX.25 packet and kick it into a TTY queue. */
+294
drivers/net/ifb.c
···11+/* drivers/net/ifb.c: 22+33+ The purpose of this driver is to provide a device that allows44+ for sharing of resources:55+66+ 1) qdiscs/policies that are per device as opposed to system wide.77+ ifb allows for a device which can be redirected to thus providing88+ an impression of sharing.99+1010+ 2) Allows for queueing incoming traffic for shaping instead of1111+ dropping. 1212+1313+ The original concept is based on what is known as the IMQ1414+ driver initially written by Martin Devera, later rewritten1515+ by Patrick McHardy and then maintained by Andre Correa.1616+1717+ You need the tc action mirror or redirect to feed this device1818+ packets.1919+2020+ This program is free software; you can redistribute it and/or2121+ modify it under the terms of the GNU General Public License2222+ as published by the Free Software Foundation; either version2323+ 2 of the License, or (at your option) any later version.2424+2525+ Authors: Jamal Hadi Salim (2005)2626+2727+*/2828+2929+3030+#include <linux/config.h>3131+#include <linux/module.h>3232+#include <linux/kernel.h>3333+#include <linux/netdevice.h>3434+#include <linux/etherdevice.h>3535+#include <linux/init.h>3636+#include <linux/moduleparam.h>3737+#include <net/pkt_sched.h> 3838+3939+#define TX_TIMEOUT (2*HZ)4040+4141+#define TX_Q_LIMIT 324242+struct ifb_private {4343+ struct net_device_stats stats;4444+ struct tasklet_struct ifb_tasklet;4545+ int tasklet_pending;4646+ /* mostly debug stats leave in for now */4747+ unsigned long st_task_enter; /* tasklet entered */4848+ unsigned long st_txq_refl_try; /* transmit queue refill attempt */4949+ unsigned long st_rxq_enter; /* receive queue entered */5050+ unsigned long st_rx2tx_tran; /* receive to trasmit transfers */5151+ unsigned long st_rxq_notenter; /*receiveQ not entered, resched */5252+ unsigned long st_rx_frm_egr; /* received from egress path */5353+ unsigned long st_rx_frm_ing; /* received from ingress path */5454+ unsigned long st_rxq_check;5555+ unsigned long st_rxq_rsch;5656+ struct sk_buff_head rq;5757+ struct sk_buff_head tq;5858+};5959+6060+static int numifbs = 1;6161+6262+static void ri_tasklet(unsigned long dev);6363+static int ifb_xmit(struct sk_buff *skb, struct net_device *dev);6464+static struct net_device_stats *ifb_get_stats(struct net_device *dev);6565+static int ifb_open(struct net_device *dev);6666+static int ifb_close(struct net_device *dev);6767+6868+static void ri_tasklet(unsigned long dev) 6969+{7070+7171+ struct net_device *_dev = (struct net_device *)dev;7272+ struct ifb_private *dp = netdev_priv(_dev);7373+ struct net_device_stats *stats = &dp->stats;7474+ struct sk_buff *skb;7575+7676+ dp->st_task_enter++;7777+ if ((skb = skb_peek(&dp->tq)) == NULL) {7878+ dp->st_txq_refl_try++;7979+ if (spin_trylock(&_dev->xmit_lock)) {8080+ dp->st_rxq_enter++;8181+ while ((skb = skb_dequeue(&dp->rq)) != NULL) {8282+ skb_queue_tail(&dp->tq, skb);8383+ dp->st_rx2tx_tran++;8484+ }8585+ spin_unlock(&_dev->xmit_lock);8686+ } else {8787+ /* reschedule */8888+ dp->st_rxq_notenter++;8989+ goto resched;9090+ }9191+ }9292+9393+ while ((skb = skb_dequeue(&dp->tq)) != NULL) {9494+ u32 from = G_TC_FROM(skb->tc_verd);9595+9696+ skb->tc_verd = 0;9797+ skb->tc_verd = SET_TC_NCLS(skb->tc_verd);9898+ stats->tx_packets++;9999+ stats->tx_bytes +=skb->len;100100+ if (from & AT_EGRESS) {101101+ dp->st_rx_frm_egr++;102102+ dev_queue_xmit(skb);103103+ } else if (from & AT_INGRESS) {104104+105105+ dp->st_rx_frm_ing++;106106+ netif_rx(skb);107107+ } else {108108+ dev_kfree_skb(skb);109109+ stats->tx_dropped++;110110+ }111111+ }112112+113113+ if (spin_trylock(&_dev->xmit_lock)) {114114+ dp->st_rxq_check++;115115+ if ((skb = skb_peek(&dp->rq)) == NULL) {116116+ dp->tasklet_pending = 0;117117+ if (netif_queue_stopped(_dev))118118+ netif_wake_queue(_dev);119119+ } else {120120+ dp->st_rxq_rsch++;121121+ spin_unlock(&_dev->xmit_lock);122122+ goto resched;123123+ }124124+ spin_unlock(&_dev->xmit_lock);125125+ } else {126126+resched:127127+ dp->tasklet_pending = 1;128128+ tasklet_schedule(&dp->ifb_tasklet);129129+ }130130+131131+}132132+133133+static void __init ifb_setup(struct net_device *dev)134134+{135135+ /* Initialize the device structure. */136136+ dev->get_stats = ifb_get_stats;137137+ dev->hard_start_xmit = ifb_xmit;138138+ dev->open = &ifb_open;139139+ dev->stop = &ifb_close;140140+141141+ /* Fill in device structure with ethernet-generic values. */142142+ ether_setup(dev);143143+ dev->tx_queue_len = TX_Q_LIMIT;144144+ dev->change_mtu = NULL;145145+ dev->flags |= IFF_NOARP;146146+ dev->flags &= ~IFF_MULTICAST;147147+ SET_MODULE_OWNER(dev);148148+ random_ether_addr(dev->dev_addr);149149+}150150+151151+static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)152152+{153153+ struct ifb_private *dp = netdev_priv(dev);154154+ struct net_device_stats *stats = &dp->stats;155155+ int ret = 0;156156+ u32 from = G_TC_FROM(skb->tc_verd);157157+158158+ stats->tx_packets++;159159+ stats->tx_bytes+=skb->len;160160+161161+ if (!from || !skb->input_dev) {162162+dropped:163163+ dev_kfree_skb(skb);164164+ stats->rx_dropped++;165165+ return ret;166166+ } else {167167+ /* 168168+ * note we could be going169169+ * ingress -> egress or170170+ * egress -> ingress171171+ */172172+ skb->dev = skb->input_dev;173173+ skb->input_dev = dev;174174+ if (from & AT_INGRESS) {175175+ skb_pull(skb, skb->dev->hard_header_len);176176+ } else {177177+ if (!(from & AT_EGRESS)) {178178+ goto dropped;179179+ }180180+ }181181+ }182182+183183+ if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) {184184+ netif_stop_queue(dev);185185+ }186186+187187+ dev->trans_start = jiffies;188188+ skb_queue_tail(&dp->rq, skb);189189+ if (!dp->tasklet_pending) {190190+ dp->tasklet_pending = 1;191191+ tasklet_schedule(&dp->ifb_tasklet);192192+ }193193+194194+ return ret;195195+}196196+197197+static struct net_device_stats *ifb_get_stats(struct net_device *dev)198198+{199199+ struct ifb_private *dp = netdev_priv(dev);200200+ struct net_device_stats *stats = &dp->stats;201201+202202+ pr_debug("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n",203203+ dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter, 204204+ dp->st_rx2tx_tran dp->st_rxq_notenter, dp->st_rx_frm_egr,205205+ dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch );206206+207207+ return stats;208208+}209209+210210+static struct net_device **ifbs;211211+212212+/* Number of ifb devices to be set up by this module. */213213+module_param(numifbs, int, 0);214214+MODULE_PARM_DESC(numifbs, "Number of ifb devices");215215+216216+static int ifb_close(struct net_device *dev)217217+{218218+ struct ifb_private *dp = netdev_priv(dev);219219+220220+ tasklet_kill(&dp->ifb_tasklet);221221+ netif_stop_queue(dev);222222+ skb_queue_purge(&dp->rq);223223+ skb_queue_purge(&dp->tq);224224+ return 0;225225+}226226+227227+static int ifb_open(struct net_device *dev)228228+{229229+ struct ifb_private *dp = netdev_priv(dev);230230+231231+ tasklet_init(&dp->ifb_tasklet, ri_tasklet, (unsigned long)dev);232232+ skb_queue_head_init(&dp->rq);233233+ skb_queue_head_init(&dp->tq);234234+ netif_start_queue(dev);235235+236236+ return 0;237237+}238238+239239+static int __init ifb_init_one(int index)240240+{241241+ struct net_device *dev_ifb;242242+ int err;243243+244244+ dev_ifb = alloc_netdev(sizeof(struct ifb_private),245245+ "ifb%d", ifb_setup);246246+247247+ if (!dev_ifb)248248+ return -ENOMEM;249249+250250+ if ((err = register_netdev(dev_ifb))) {251251+ free_netdev(dev_ifb);252252+ dev_ifb = NULL;253253+ } else {254254+ ifbs[index] = dev_ifb; 255255+ }256256+257257+ return err;258258+}259259+260260+static void ifb_free_one(int index)261261+{262262+ unregister_netdev(ifbs[index]);263263+ free_netdev(ifbs[index]);264264+} 265265+266266+static int __init ifb_init_module(void)267267+{ 268268+ int i, err = 0;269269+ ifbs = kmalloc(numifbs * sizeof(void *), GFP_KERNEL); 270270+ if (!ifbs)271271+ return -ENOMEM; 272272+ for (i = 0; i < numifbs && !err; i++)273273+ err = ifb_init_one(i); 274274+ if (err) { 275275+ while (--i >= 0)276276+ ifb_free_one(i);277277+ }278278+279279+ return err;280280+} 281281+282282+static void __exit ifb_cleanup_module(void)283283+{284284+ int i;285285+286286+ for (i = 0; i < numifbs; i++) 287287+ ifb_free_one(i); 288288+ kfree(ifbs); 289289+}290290+291291+module_init(ifb_init_module);292292+module_exit(ifb_cleanup_module);293293+MODULE_LICENSE("GPL");294294+MODULE_AUTHOR("Jamal Hadi Salim");
+5
include/linux/crypto.h
···33 *44 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>55 * Copyright (c) 2002 David S. Miller (davem@redhat.com)66+ * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au>67 *78 * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no>89 * and Nettle, by Niels M�ller.···127126 unsigned int cra_blocksize;128127 unsigned int cra_ctxsize;129128 unsigned int cra_alignmask;129129+130130+ int cra_priority;131131+130132 const char cra_name[CRYPTO_MAX_ALG_NAME];133133+ const char cra_driver_name[CRYPTO_MAX_ALG_NAME];131134132135 union {133136 struct cipher_alg cipher;
+1-1
include/net/act_api.h
···6363 __u32 type; /* TBD to match kind */6464 __u32 capab; /* capabilities includes 4 bit version */6565 struct module *owner;6666- int (*act)(struct sk_buff **, struct tc_action *, struct tcf_result *);6666+ int (*act)(struct sk_buff *, struct tc_action *, struct tcf_result *);6767 int (*get_stats)(struct sk_buff *, struct tc_action *);6868 int (*dump)(struct sk_buff *, struct tc_action *,int , int);6969 int (*cleanup)(struct tc_action *, int bind);
···304304 /* look for a node to insert instead of p */305305 struct inet_peer *t;306306 t = lookup_rightempty(p);307307- if (*stackptr[-1] != t)308308- BUG();307307+ BUG_ON(*stackptr[-1] != t);309308 **--stackptr = t->avl_left;310309 /* t is removed, t->v4daddr > x->v4daddr for any311310 * x in p->avl_left subtree.···313314 t->avl_left = p->avl_left;314315 t->avl_right = p->avl_right;315316 t->avl_height = p->avl_height;316316- if (delp[1] != &p->avl_left)317317- BUG();317317+ BUG_ON(delp[1] != &p->avl_left);318318 delp[1] = &t->avl_left; /* was &p->avl_left */319319 }320320 peer_avl_rebalance(stack, stackptr);
···201201}202202203203static int204204-tcf_ipt(struct sk_buff **pskb, struct tc_action *a, struct tcf_result *res)204204+tcf_ipt(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res)205205{206206 int ret = 0, result = 0;207207 struct tcf_ipt *p = PRIV(a, ipt);208208- struct sk_buff *skb = *pskb;209208210209 if (skb_cloned(skb)) {211210 if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC))···221222 worry later - danger - this API seems to have changed222223 from earlier kernels */223224225225+ /* iptables targets take a double skb pointer in case the skb226226+ * needs to be replaced. We don't own the skb, so this must not227227+ * happen. The pskb_expand_head above should make sure of this */224228 ret = p->t->u.kernel.target->target(&skb, skb->dev, NULL,225229 p->hook, p->t->data, NULL);226230 switch (ret) {
···248248249249void __xfrm_policy_destroy(struct xfrm_policy *policy)250250{251251- if (!policy->dead)252252- BUG();251251+ BUG_ON(!policy->dead);253252254254- if (policy->bundles)255255- BUG();253253+ BUG_ON(policy->bundles);256254257255 if (del_timer(&policy->timer))258256 BUG();