Major stylo search/replace for "One space between keyword and opening bracket."

This commit is contained in:
likewise 2003-05-01 13:24:01 +00:00
parent 4c3f44b0d2
commit 03bc7c868b
27 changed files with 624 additions and 601 deletions

View File

@ -4,6 +4,8 @@ HISTORY
++ Changes:
* Now drops short packets for ICMP/UDP/TCP protocols. More robust.
* ARP queueuing now queues the latest packet instead of the first.
This is the recommended behaviour, but can be overridden in
lwipopts.h.

View File

@ -8,29 +8,36 @@ features of Savannah help us not lose users' input.
Source code style:
- indentation is two spaces per level, no tabs.
- do not use tabs.
- indentation is two spaces per level.
- end debug messages with a trailing newline (\n).
- no space between function and opening bracket.
- one space between keyword and opening bracket.
- one space and no newline before opening curly braces.
- no space between function and opening bracket.
- one space and no newline before opening curly braces of a block.
- spaces surrounding assignment and comparisons.
- use current source code style as further reference.
Source code self documentation style:
Source code documentation style:
- JavaDoc compliant and Doxygen compatible.
- Function documentation above functions in .c files, not .h files.
(This forces you to synchronize documentation and behaviour.)
- Use current documentation style as further reference.
Bug reports and patches:
- Make sure you are reporting bugs or send patches against the latest sources.That usually means code in CVS
- If you think you found a bug make sure it's not already filed in the bugtracker at savannah
- If you have a fix put the patch on Savannah. If it's a patch that affects both core and arch specific
stuff please separate them so that the core can be applied separately while leaving the other patch 'open'
The prefered way is to NOT touch archs you can't test and let maintainers take care of them. This is a good
way to see if they are used at all - the same goes for unix netifs except tapif.
- Do not file a bug and post a fix to it to the patch area. Either a bug report or a patch will be enough.
- Make sure you are reporting bugs or send patches against the latest
sources. (From the latest release and/or the current CVS sources.)
- If you think you found a bug make sure it's not already filed in the
bugtracker at Savannah.
- If you have a fix put the patch on Savannah. If it is a patch that affects
both core and arch specific stuff please separate them so that the core can
be applied separately while leaving the other patch 'open'. The prefered way
is to NOT touch archs you can't test and let maintainers take care of them.
This is a good way to see if they are used at all - the same goes for unix
netifs except tapif.
- Do not file a bug and post a fix to it to the patch area. Either a bug report
or a patch will be enough.
If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area.
- Trivial patches (compiler warning, indentation and spelling fixes or anything obvious which takes a line or two)
can go to the lwip-users list. This is still the fastest way of interaction and the list is not so crowded

View File

@ -2,6 +2,10 @@
* @file
* Address Resolution Protocol module for IP over Ethernet
*
* Functionally, ARP is divided into two parts. The first maps an IP address
* to a physical address when sending a packet, and the second part answers
* requests from other machines.
*
*/
/*
@ -209,7 +213,11 @@ find_arp_entry(void)
j = i;
}
}
if (j != ARP_TABLE_SIZE) {
DEBUGF(ETHARP_DEBUG, ("find_arp_entry: found oldest stable entry %u\n", j));
} else {
DEBUGF(ETHARP_DEBUG, ("find_arp_entry: no replacable entry could be found\n", j));
}
i = j;
}
DEBUGF(ETHARP_DEBUG, ("find_arp_entry: returning %u, state %u\n", i, arp_table[i].state));
@ -234,11 +242,8 @@ static struct pbuf *
update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
{
u8_t i, k;
#if ARP_QUEUEING
struct pbuf *p;
struct eth_hdr *ethhdr;
#endif
DEBUGF(ETHARP_DEBUG | DBG_TRACE | 3, ("update_arp_entry()\n"));
LWIP_ASSERT("netif->hwaddr_len != 0", netif->hwaddr_len != 0);
DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("update_arp_entry: %u.%u.%u.%u - %02x:%02x:%02x:%02x:%02x:%02x\n", ip4_addr1(ipaddr), ip4_addr2(ipaddr), ip4_addr3(ipaddr), ip4_addr4(ipaddr),
ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2], ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
/* do not update for 0.0.0.0 addresses */
@ -262,6 +267,10 @@ update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *e
}
/* stable entry? (possible just marked to become stable) */
if (arp_table[i].state == ETHARP_STATE_STABLE) {
#if ARP_QUEUEING
struct pbuf *p;
struct eth_hdr *ethhdr;
#endif
DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("update_arp_entry: updating stable entry %u\n", i));
/* An old entry found, update this and return. */
for (k = 0; k < netif->hwaddr_len; ++k) {
@ -270,9 +279,10 @@ update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *e
/* reset time stamp */
arp_table[i].ctime = 0;
#if ARP_QUEUEING
p = arp_table[i].p;
/* queued packet present? */
if((p = arp_table[i].p) != NULL) {
/* Null out attached buffer immediately */
if (p != NULL) {
/* NULL attached buffer immediately */
arp_table[i].p = NULL;
/* fill-in Ethernet header */
ethhdr = p->payload;
@ -656,12 +666,14 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
if (arp_table[i].state == ETHARP_STATE_PENDING) {
DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: requested IP already pending as entry %u\n", i));
/* break out of for-loop, user may wish to queue a packet on a stable entry */
/* TODO: we will issue a new ARP request, which should not occur too often */
/* we might want to run a faster timer on ARP to limit this */
break;
}
else if (arp_table[i].state == ETHARP_STATE_STABLE) {
DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: requested IP already stable as entry %u\n", i));
/* user may wish to queue a packet on a stable entry, so we proceed without ARP requesting */
/* TODO: even if the ARP entry is stable, we might do an ARP request anyway in some cases? */
/* TODO: even if the ARP entry is stable, we might do an ARP request anyway */
perform_arp_request = 0;
break;
}
@ -677,6 +689,7 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
DEBUGF(ETHARP_DEBUG | 2, ("etharp_query: no more ARP entries available.\n"));
return ERR_MEM;
}
/* we will now recycle entry i */
DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_query: created ARP table entry %u.\n", i));
/* i is available, create ARP entry */
ip_addr_set(&arp_table[i].ipaddr, ipaddr);
@ -701,11 +714,12 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
pbuf_free(arp_table[i].p);
arp_table[i].p = NULL;
DEBUGF(ETHARP_DEBUG | DBG_TRACE | 3, ("etharp_query: dropped packet on ARP queue. Should not occur.\n"));
/* fall-through into next if */
}
#endif
/* packet can be queued? */
if (arp_table[i].p == NULL) {
/* copy PBUF_REF referenced payloads to PBUF_RAM */
/* copy PBUF_REF referenced payloads into PBUF_RAM */
q = pbuf_take(q);
/* remember pbuf to queue, if any */
arp_table[i].p = q;