You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/01/16 11:45:08 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #2695: netpacket/if_addr: add interface address header

anchao opened a new pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695


   ## Summary
   
   netpacket/if_addr: add interface address header 
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   ## Impact
   
   N/A
   
   ## Testing
   
   CI check is enough


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r559072909



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       Update for resolve the style issue




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r558903411



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       > 
   > 
   > Because it's a macro?
   
   That is probably why nxstyle failed to detect the coding standard violation for some reason.
   
   A lot of checking is not turned on until "Private Functions" or "Public Functions" is encountered.
   
       1179       /* Check for the comment block indicating the beginning of a new file
       1180        * section.
       1181        */
       1182
       1183       if (check_section_header(line, lineno))
       1184         {
       1185           if (g_section == PRIVATE_FUNCTIONS || g_section == PUBLIC_FUNCTIONS)
       1186             {
       1187               bfunctions = true;  /* Latched */
       1188             }
       1189         }
   
   bfunctions == false probably introduces the failure in nxstyle.
   
   OR maybe your are right.  Perhaps it is just a bug in nxstyle that depends on a macro following a comment.  Those should be separated with blank linkes.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r558880684



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       All comments should be followed by a blank line.  Not detected by nxstyle?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r558903411



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       > 
   > 
   > Because it's a macro?
   
   That is probably why nxstyle failed to detect the coding standard violation for some reason.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r558903411



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       > 
   > 
   > Because it's a macro?
   
   That is probably why nxstyle failed to detect the coding standard violation for some reason.
   
   A lot of checking is not turned on until "Private Functions" or "Public Functions" is encountered.
   
       1179       /* Check for the comment block indicating the beginning of a new file
       1180        * section.
       1181        */
       1182
       1183       if (check_section_header(line, lineno))
       1184         {
       1185           if (g_section == PRIVATE_FUNCTIONS || g_section == PUBLIC_FUNCTIONS)
       1186             {
       1187               bfunctions = true;  /* Latched */
       1188             }
       1189         }
   
   bfunctions == false probably introduces the failure in nxstyle.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2695: netpacket/if_addr: add interface address header

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2695:
URL: https://github.com/apache/incubator-nuttx/pull/2695#discussion_r558893070



##########
File path: include/netpacket/if_addr.h
##########
@@ -0,0 +1,110 @@
+/****************************************************************************
+ * include/netpacket/if_addr.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_IF_ADDR_H
+#define __INCLUDE_NETPACKET_IF_ADDR_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <netpacket/netlink.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY       0x01
+#define IFA_F_TEMPORARY       IFA_F_SECONDARY
+
+#define IFA_F_NODAD           0x02
+#define IFA_F_OPTIMISTIC      0x04
+#define IFA_F_DADFAILED       0x08
+#define IFA_F_HOMEADDRESS     0x10
+#define IFA_F_DEPRECATED      0x20
+#define IFA_F_TENTATIVE       0x40
+#define IFA_F_PERMANENT       0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE  0x200
+#define IFA_F_MCAUTOJOIN     0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r)  ((FAR struct rtattr *)(((FAR char *)(r)) + \

Review comment:
       Because it's a macro?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org