]> err.no Git - linux-2.6/blobdiff - net/sctp/proc.c
[IPSEC]: Add xfrm_input_state helper
[linux-2.6] / net / sctp / proc.c
index 47ccec565a240fdfe7935587f983d27fdeebf4d1..249973204070bfb811085b3b2ce988b7dc093128 100644 (file)
@@ -77,7 +77,7 @@ static struct snmp_mib sctp_snmp_list[] = {
 
 /* Return the current value of a particular entry in the mib by adding its
  * per cpu counters.
- */ 
+ */
 static unsigned long
 fold_field(void *mib[], int nr)
 {
@@ -102,7 +102,7 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
 
        for (i = 0; sctp_snmp_list[i].name != NULL; i++)
                seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
-                          fold_field((void **)sctp_statistics, 
+                          fold_field((void **)sctp_statistics,
                                      sctp_snmp_list[i].entry));
 
        return 0;
@@ -114,7 +114,7 @@ static int sctp_snmp_seq_open(struct inode *inode, struct file *file)
        return single_open(file, sctp_snmp_seq_show, NULL);
 }
 
-static struct file_operations sctp_snmp_seq_fops = {
+static const struct file_operations sctp_snmp_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = sctp_snmp_seq_open,
        .read    = seq_read,
@@ -155,12 +155,12 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
        if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
            asoc = sctp_assoc(epb);
            peer = asoc->peer.primary_path;
-           primary = &peer->saddr_h;
+           primary = &peer->saddr;
        }
 
        list_for_each(pos, &epb->bind_addr.address_list) {
                laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               addr = (union sctp_addr *)&laddr->a_h;
+               addr = &laddr->a;
                af = sctp_get_af_specific(addr->sa.sa_family);
                if (primary && af->cmp_addr(addr, primary)) {
                        seq_printf(seq, "*");
@@ -177,10 +177,10 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
        union sctp_addr *addr, *primary;
        struct sctp_af *af;
 
-       primary = &(assoc->peer.primary_addr);
+       primary = &assoc->peer.primary_addr;
        list_for_each(pos, &assoc->peer.transport_addr_list) {
                transport = list_entry(pos, struct sctp_transport, transports);
-               addr = (union sctp_addr *)&transport->ipaddr_h;
+               addr = &transport->ipaddr;
                af = sctp_get_af_specific(addr->sa.sa_family);
                if (af->cmp_addr(addr, primary)) {
                        seq_printf(seq, "*");
@@ -225,6 +225,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
        struct sctp_ep_common *epb;
        struct sctp_endpoint *ep;
        struct sock *sk;
+       struct hlist_node *node;
        int    hash = *(loff_t *)v;
 
        if (hash >= sctp_ep_hashsize)
@@ -233,7 +234,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
        head = &sctp_ep_hashtable[hash];
        sctp_local_bh_disable();
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                ep = sctp_ep(epb);
                sk = epb->sk;
                seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
@@ -250,7 +251,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations sctp_eps_ops = {
+static const struct seq_operations sctp_eps_ops = {
        .start = sctp_eps_seq_start,
        .next  = sctp_eps_seq_next,
        .stop  = sctp_eps_seq_stop,
@@ -264,7 +265,7 @@ static int sctp_eps_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &sctp_eps_ops);
 }
 
-static struct file_operations sctp_eps_seq_fops = {
+static const struct file_operations sctp_eps_seq_fops = {
        .open    = sctp_eps_seq_open,
        .read    = seq_read,
        .llseek  = seq_lseek,
@@ -328,6 +329,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
        struct sctp_ep_common *epb;
        struct sctp_association *assoc;
        struct sock *sk;
+       struct hlist_node *node;
        int    hash = *(loff_t *)v;
 
        if (hash >= sctp_assoc_hashsize)
@@ -336,7 +338,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
        head = &sctp_assoc_hashtable[hash];
        sctp_local_bh_disable();
        read_lock(&head->lock);
-       for (epb = head->chain; epb; epb = epb->next) {
+       sctp_for_each_hentry(epb, node, &head->chain) {
                assoc = sctp_assoc(epb);
                sk = epb->sk;
                seq_printf(seq,
@@ -361,7 +363,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations sctp_assoc_ops = {
+static const struct seq_operations sctp_assoc_ops = {
        .start = sctp_assocs_seq_start,
        .next  = sctp_assocs_seq_next,
        .stop  = sctp_assocs_seq_stop,
@@ -374,7 +376,7 @@ static int sctp_assocs_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &sctp_assoc_ops);
 }
 
-static struct file_operations sctp_assocs_seq_fops = {
+static const struct file_operations sctp_assocs_seq_fops = {
        .open    = sctp_assocs_seq_open,
        .read    = seq_read,
        .llseek  = seq_lseek,