Merge lp:~christof-mroz/hipl/rename-camelcased into lp:hipl

Proposed by Christof Mroz
Status: Merged
Approved by: René Hummen
Approved revision: 5756
Merged at revision: 5770
Proposed branch: lp:~christof-mroz/hipl/rename-camelcased
Merge into: lp:hipl
Diff against target: 223 lines (+37/-36)
6 files modified
firewall/conntrack.c (+2/-2)
firewall/firewall.c (+12/-12)
firewall/lsi.c (+16/-15)
firewall/lsi.h (+1/-1)
hipd/cookie.c (+3/-3)
lib/core/conf.c (+3/-3)
To merge this branch: bzr merge lp:~christof-mroz/hipl/rename-camelcased
Reviewer Review Type Date Requested Status
Stefan Götz (community) Approve
Review via email: mp+53798@code.launchpad.net

Description of the change

Renames camelcased identifiers to use an equivalent using underscores, or at least those found using the regex [a-z][A-Z].

To post a comment you must log in.
Revision history for this message
Stefan Götz (stefan.goetz-deactivatedaccount) wrote :

Looks good to me

review: Approve
Revision history for this message
René Hummen (rene-hummen) wrote :

Does exactly what's promised in the description.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'firewall/conntrack.c'
2--- firewall/conntrack.c 2011-03-11 10:18:34 +0000
3+++ firewall/conntrack.c 2011-03-17 12:13:31 +0000
4@@ -84,8 +84,8 @@
5 STATE_CLOSING
6 };
7
8-int timeoutChecking = 0;
9-unsigned long timeoutValue = 0;
10+int timeout_checking = 0;
11+unsigned long timeout_value = 0;
12
13 /*------------print functions-------------*/
14 /**
15
16=== modified file 'firewall/firewall.c'
17--- firewall/firewall.c 2011-03-10 11:53:43 +0000
18+++ firewall/firewall.c 2011-03-17 12:13:31 +0000
19@@ -1562,16 +1562,16 @@
20 /**
21 * Set an accept verdict for a modified packet
22 *
23- * @param handle ipqueue file handle
24- * @param packetId ipqueue packet id
25- * @param len length of buf
26- * @param buf the packet to be accepted
27+ * @param handle ipqueue file handle
28+ * @param packet_id ipqueue packet id
29+ * @param len length of buf
30+ * @param buf the packet to be accepted
31 *
32 */
33-static void allow_modified_packet(struct ipq_handle *handle, unsigned long packetId,
34+static void allow_modified_packet(struct ipq_handle *handle, unsigned long packet_id,
35 size_t len, unsigned char *buf)
36 {
37- ipq_set_verdict(handle, packetId, NF_ACCEPT, len, buf);
38+ ipq_set_verdict(handle, packet_id, NF_ACCEPT, len, buf);
39 HIP_DEBUG("Packet accepted with modifications\n\n");
40 }
41
42@@ -1579,12 +1579,12 @@
43 * Allow a packet to pass
44 *
45 * @param handle the handle for the packets.
46- * @param packetId the packet ID.
47+ * @param packet_id the packet ID.
48 * @return nothing
49 */
50-static void allow_packet(struct ipq_handle *handle, unsigned long packetId)
51+static void allow_packet(struct ipq_handle *handle, unsigned long packet_id)
52 {
53- ipq_set_verdict(handle, packetId, NF_ACCEPT, 0, NULL);
54+ ipq_set_verdict(handle, packet_id, NF_ACCEPT, 0, NULL);
55
56 HIP_DEBUG("Packet accepted \n\n");
57 }
58@@ -1593,12 +1593,12 @@
59 * Drop a packet
60 *
61 * @param handle the handle for the packets.
62- * @param packetId the packet ID.
63+ * @param packet_id the packet ID.
64 * @return nothing
65 */
66-static void drop_packet(struct ipq_handle *handle, unsigned long packetId)
67+static void drop_packet(struct ipq_handle *handle, unsigned long packet_id)
68 {
69- ipq_set_verdict(handle, packetId, NF_DROP, 0, NULL);
70+ ipq_set_verdict(handle, packet_id, NF_DROP, 0, NULL);
71
72 HIP_DEBUG("Packet dropped \n\n");
73 }
74
75=== modified file 'firewall/lsi.c'
76--- firewall/lsi.c 2011-01-10 11:54:10 +0000
77+++ firewall/lsi.c 2011-03-17 12:13:31 +0000
78@@ -197,17 +197,17 @@
79 * Executes the packet reinjection
80 *
81 *
82- * @param src_hit ipv6 source address
83- * @param dst_hit ipv6 destination address
84- * @param m pointer to the packet
85- * @param ipOrigTraffic type of Traffic (IPv4 or IPv6)
86- * @param incoming packet direction
87- * @return err during the reinjection
88+ * @param src_hit ipv6 source address
89+ * @param dst_hit ipv6 destination address
90+ * @param m pointer to the packet
91+ * @param ip_orig_traffic type of Traffic (IPv4 or IPv6)
92+ * @param incoming packet direction
93+ * @return err during the reinjection
94 */
95 int hip_reinject_packet(const struct in6_addr *src_hit,
96 const struct in6_addr *dst_hit,
97 const ipq_packet_msg_t *m,
98- const int ipOrigTraffic,
99+ const int ip_orig_traffic,
100 const int incoming)
101 {
102 int err = 0;
103@@ -218,7 +218,7 @@
104 uint8_t *msg = NULL;
105 struct icmphdr *icmp = NULL;
106
107- if (ipOrigTraffic == 4) {
108+ if (ip_orig_traffic == 4) {
109 const struct ip *iphdr = (const struct ip *) m->payload;
110 ip_hdr_size = (iphdr->ip_hl * 4);
111 protocol = iphdr->ip_p;
112@@ -309,7 +309,7 @@
113 int err = 0;
114 int verdict = 1;
115 int ip_hdr_size = 0;
116- int portDest = 0;
117+ int port_dest = 0;
118 struct hip_hadb_user_info_state *entry = NULL;
119 enum hip_port_binding port_binding = HIP_PORT_INFO_UNKNOWN;
120 const struct ip6_hdr *ip6_hdr = NULL;
121@@ -320,10 +320,10 @@
122
123 switch (ip6_hdr->ip6_nxt) {
124 case IPPROTO_UDP:
125- portDest = ((const struct udphdr *) ((m->payload) + ip_hdr_size))->dest;
126+ port_dest = ((const struct udphdr *) ((m->payload) + ip_hdr_size))->dest;
127 break;
128 case IPPROTO_TCP:
129- portDest = ((const struct tcphdr *) ((m->payload) + ip_hdr_size))->dest;
130+ port_dest = ((const struct tcphdr *) ((m->payload) + ip_hdr_size))->dest;
131 break;
132 case IPPROTO_ICMPV6:
133 HIP_DEBUG("ICMPv6 packet\n");
134@@ -333,14 +333,15 @@
135 break;
136 }
137
138- port_binding = hip_port_bindings_get(ip6_hdr->ip6_nxt,
139- portDest);
140+ port_binding = hip_port_bindings_get(ip6_hdr->ip6_nxt, port_dest);
141
142 if (port_binding == HIP_PORT_INFO_IPV6BOUND) {
143- HIP_DEBUG("Port %d is bound to an IPv6 address -> accepting packet\n", portDest);
144+ HIP_DEBUG("Port %d is bound to an IPv6 address -> accepting packet\n",
145+ port_dest);
146 verdict = 1;
147 } else if (port_binding == HIP_PORT_INFO_IPV6UNBOUND) {
148- HIP_DEBUG("Port %d is unbound or bound to an IPv4 address -> looking up in cache\n", portDest);
149+ HIP_DEBUG("Port %d is unbound or bound to an IPv4 address -> looking up in cache\n",
150+ port_dest);
151 HIP_IFEL(!(entry = hip_firewall_cache_db_match(ip_dst, ip_src,
152 FW_CACHE_HIT, 1)),
153 -1, "Failed to obtain from cache\n");
154
155=== modified file 'firewall/lsi.h'
156--- firewall/lsi.h 2010-10-15 15:29:14 +0000
157+++ firewall/lsi.h 2011-03-17 12:13:31 +0000
158@@ -52,7 +52,7 @@
159 int hip_reinject_packet(const struct in6_addr *src_hit,
160 const struct in6_addr *dst_hit,
161 const ipq_packet_msg_t *m,
162- const int ipOrigTraffic,
163+ const int ip_orig_traffic,
164 const int incoming);
165
166 #endif /* HIP_FIREWALL_LSI_H */
167
168=== modified file 'hipd/cookie.c'
169--- hipd/cookie.c 2011-02-22 19:12:13 +0000
170+++ hipd/cookie.c 2011-03-17 12:13:31 +0000
171@@ -115,18 +115,18 @@
172 */
173 int hip_set_puzzle_difficulty_msg(struct hip_common *msg)
174 {
175- const int *newVal = NULL;
176+ const int *new_val = NULL;
177 const hip_hit_t *dst_hit = NULL;
178
179 if (!(dst_hit = hip_get_param_contents(msg, HIP_PARAM_HIT))) {
180 HIP_ERROR("No HIT set\n");
181 return -1;
182 }
183- if (!(newVal = hip_get_param_contents(msg, HIP_PARAM_INT))) {
184+ if (!(new_val = hip_get_param_contents(msg, HIP_PARAM_INT))) {
185 HIP_ERROR("No difficulty set\n");
186 return -1;
187 }
188- if (hip_set_cookie_difficulty(*newVal), -1) {
189+ if (hip_set_cookie_difficulty(*new_val), -1) {
190 HIP_ERROR("Setting difficulty failed\n");
191 return -1;
192 }
193
194=== modified file 'lib/core/conf.c'
195--- lib/core/conf.c 2011-02-20 17:25:58 +0000
196+++ lib/core/conf.c 2011-03-17 12:13:31 +0000
197@@ -1603,7 +1603,7 @@
198 int optc,
199 int send_only)
200 {
201- int err = 0, ret = 0, msg_type = 0, all, newVal = 0;
202+ int err = 0, ret = 0, msg_type = 0, all, new_val = 0;
203 const int *diff = NULL;
204 hip_hit_t hit = { { { 0 } } }, all_zero_hit = { { { 0 } } };
205 char hit_s[INET6_ADDRSTRLEN];
206@@ -1667,7 +1667,7 @@
207
208 /* obtain the new value for set */
209 if ((msg_type == HIP_MSG_CONF_PUZZLE_SET) && (optc == 2)) {
210- newVal = atoi(opt[1]);
211+ new_val = atoi(opt[1]);
212 }
213
214 /* Build a HIP message with socket option to get puzzle difficulty. */
215@@ -1709,7 +1709,7 @@
216
217 /* attach new val for the set action */
218 if (msg_type == HIP_MSG_CONF_PUZZLE_SET) {
219- err = hip_build_param_contents(msg, &newVal, HIP_PARAM_INT,
220+ err = hip_build_param_contents(msg, &new_val, HIP_PARAM_INT,
221 sizeof(int));
222 if (err) {
223 HIP_ERROR("build param int failed: %s\n", strerror(err));

Subscribers

People subscribed via source and target branches

to all changes: