* [B.A.T.M.A.N.] [batman-adv] packet.h coding style cleanup
@ 2009-07-17 17:25 Andrew Lunn
2009-07-17 17:46 ` Andrew Lunn
2009-07-17 18:46 ` [B.A.T.M.A.N.] [batman-adv v2] " Andrew Lunn
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Lunn @ 2009-07-17 17:25 UTC (permalink / raw)
To: B.A.T.M.A.N
Make packet.h clean with respect to the 2.6.29 checkpatch script.
Also adds one macro, BAT_PACKET_LEN, which is used in other patches
to follow.
Signed-off-by: Andrew Lunn <andrew.lunn@ascom.ch>
Index: batman-adv-kernelland/packet.h
===================================================================
--- batman-adv-kernelland/packet.h (revision 1349)
+++ batman-adv-kernelland/packet.h (working copy)
@@ -17,8 +17,6 @@
*
*/
-
-
#define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
#define BAT_PACKET 0x01
@@ -32,7 +30,6 @@
#define DIRECTLINK 0x40
#define VIS_SERVER 0x20
-
/* ICMP message types */
#define ECHO_REPLY 0
#define DESTINATION_UNREACHABLE 3
@@ -40,13 +37,11 @@
#define TTL_EXCEEDED 11
#define PARAMETER_PROBLEM 12
-
/* vis defines */
#define VIS_TYPE_SERVER_SYNC 0
#define VIS_TYPE_CLIENT_UPDATE 1
-struct batman_packet
-{
+struct batman_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
@@ -56,13 +51,15 @@
uint8_t old_orig[6];
uint8_t ttl;
uint8_t num_hna;
+ uint16_t orig_interval;
} __attribute__((packed));
-struct icmp_packet
-{
+#define BAT_PACKET_LEN sizeof(struct batman_packet)
+
+struct icmp_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t msg_type; /* see ICMP message types above */
+ uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
uint8_t dst[6];
uint8_t orig[6];
@@ -70,31 +67,29 @@
uint8_t uid;
} __attribute__((packed));
-struct unicast_packet
-{
+struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t dest[6];
uint8_t ttl;
} __attribute__((packed));
-struct bcast_packet
-{
+struct bcast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t orig[6];
uint16_t seqno;
} __attribute__((packed));
-struct vis_packet
-{
+struct vis_packet {
uint8_t packet_type;
- uint8_t version; /* batman version field */
- uint8_t vis_type; /* which type of vis-participant sent this? */
- uint8_t seqno; /* sequence number */
- uint8_t entries; /* number of entries behind this struct */
- uint8_t ttl; /* TTL */
- uint8_t vis_orig[6]; /* originator that informs about its neighbours */
- uint8_t target_orig[6]; /* who should receive this packet */
- uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
+ uint8_t version; /* batman version field */
+ uint8_t vis_type; /* which type of vis-participant sent this? */
+ uint8_t seqno; /* sequence number */
+ uint8_t entries; /* number of entries behind this struct */
+ uint8_t ttl; /* TTL */
+ uint8_t vis_orig[6]; /* originator that informs about its
+ * neighbours */
+ uint8_t target_orig[6]; /* who should receive this packet */
+ uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
} __attribute__((packed));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] [batman-adv] packet.h coding style cleanup
2009-07-17 17:25 [B.A.T.M.A.N.] [batman-adv] packet.h coding style cleanup Andrew Lunn
@ 2009-07-17 17:46 ` Andrew Lunn
2009-07-17 18:46 ` [B.A.T.M.A.N.] [batman-adv v2] " Andrew Lunn
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2009-07-17 17:46 UTC (permalink / raw)
To: B.A.T.M.A.N
On Fri, Jul 17, 2009 at 07:25:21PM +0200, Andrew Lunn wrote:
> Make packet.h clean with respect to the 2.6.29 checkpatch script.
> Also adds one macro, BAT_PACKET_LEN, which is used in other patches
> to follow.
Arg, please ignore this patch. There is something extra in there which
should not be.
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* [B.A.T.M.A.N.] [batman-adv v2] packet.h coding style cleanup
2009-07-17 17:25 [B.A.T.M.A.N.] [batman-adv] packet.h coding style cleanup Andrew Lunn
2009-07-17 17:46 ` Andrew Lunn
@ 2009-07-17 18:46 ` Andrew Lunn
2009-07-17 19:39 ` Marek Lindner
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2009-07-17 18:46 UTC (permalink / raw)
To: B.A.T.M.A.N
Make packet.h clean with respect to the 2.6.29 checkpatch script.
Also adds one macro, BAT_PACKET_LEN, which is used in other patches
to follow.
Signed-off-by: Andrew Lunn <andrew.lunn@ascom.ch>
Index: packet.h
===================================================================
--- packet.h (revision 1349)
+++ packet.h (working copy)
@@ -17,8 +17,6 @@
*
*/
-
-
#define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
#define BAT_PACKET 0x01
@@ -32,7 +30,6 @@
#define DIRECTLINK 0x40
#define VIS_SERVER 0x20
-
/* ICMP message types */
#define ECHO_REPLY 0
#define DESTINATION_UNREACHABLE 3
@@ -40,13 +37,11 @@
#define TTL_EXCEEDED 11
#define PARAMETER_PROBLEM 12
-
/* vis defines */
#define VIS_TYPE_SERVER_SYNC 0
#define VIS_TYPE_CLIENT_UPDATE 1
-struct batman_packet
-{
+struct batman_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
@@ -58,11 +53,12 @@
uint8_t num_hna;
} __attribute__((packed));
-struct icmp_packet
-{
+#define BAT_PACKET_LEN sizeof(struct batman_packet)
+
+struct icmp_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t msg_type; /* see ICMP message types above */
+ uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
uint8_t dst[6];
uint8_t orig[6];
@@ -70,31 +66,29 @@
uint8_t uid;
} __attribute__((packed));
-struct unicast_packet
-{
+struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t dest[6];
uint8_t ttl;
} __attribute__((packed));
-struct bcast_packet
-{
+struct bcast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t orig[6];
uint16_t seqno;
} __attribute__((packed));
-struct vis_packet
-{
+struct vis_packet {
uint8_t packet_type;
- uint8_t version; /* batman version field */
- uint8_t vis_type; /* which type of vis-participant sent this? */
- uint8_t seqno; /* sequence number */
- uint8_t entries; /* number of entries behind this struct */
- uint8_t ttl; /* TTL */
- uint8_t vis_orig[6]; /* originator that informs about its neighbours */
- uint8_t target_orig[6]; /* who should receive this packet */
- uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
+ uint8_t version; /* batman version field */
+ uint8_t vis_type; /* which type of vis-participant sent this? */
+ uint8_t seqno; /* sequence number */
+ uint8_t entries; /* number of entries behind this struct */
+ uint8_t ttl; /* TTL */
+ uint8_t vis_orig[6]; /* originator that informs about its
+ * neighbours */
+ uint8_t target_orig[6]; /* who should receive this packet */
+ uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
} __attribute__((packed));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] [batman-adv v2] packet.h coding style cleanup
2009-07-17 18:46 ` [B.A.T.M.A.N.] [batman-adv v2] " Andrew Lunn
@ 2009-07-17 19:39 ` Marek Lindner
0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2009-07-17 19:39 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Saturday 18 July 2009 02:46:14 Andrew Lunn wrote:
> Make packet.h clean with respect to the 2.6.29 checkpatch script.
> Also adds one macro, BAT_PACKET_LEN, which is used in other patches
> to follow.
I comitted all your patches except the vis struct changes as there were some
open issues.
Thanks for your effort,
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-17 19:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-17 17:25 [B.A.T.M.A.N.] [batman-adv] packet.h coding style cleanup Andrew Lunn
2009-07-17 17:46 ` Andrew Lunn
2009-07-17 18:46 ` [B.A.T.M.A.N.] [batman-adv v2] " Andrew Lunn
2009-07-17 19:39 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox