Changeset 4831944 in rtems-libbsd
- Timestamp:
- Jul 5, 2016, 2:31:43 PM (5 years ago)
- Branches:
- 4.11
- Children:
- 709fbfa
- Parents:
- 85dd332
- git-author:
- Christian Mauderer <Christian.Mauderer@…> (07/05/16 14:31:43)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (08/03/16 12:13:18)
- Location:
- freebsd/contrib/pf/pfctl
- Files:
-
- 8 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd/contrib/pf/pfctl/parse.y
r85dd332 r4831944 30 30 #ifdef __rtems__ 31 31 #include <machine/rtems-bsd-user-space.h> 32 #include <machine/rtems-bsd-program.h> 32 33 #define pf_find_or_create_ruleset _bsd_pf_find_or_create_ruleset 33 34 #define pf_anchor_setup _bsd_pf_anchor_setup … … 6134 6135 #endif 6135 6136 } 6137 #ifdef __rtems__ 6138 #include "parse-data.h" 6139 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pf_print_state.c
r85dd332 r4831944 33 33 */ 34 34 35 #ifdef __rtems__ 36 #include <machine/rtems-bsd-program.h> 37 #endif /* __rtems__ */ 35 38 #include <sys/cdefs.h> 36 39 __FBSDID("$FreeBSD$"); -
freebsd/contrib/pf/pfctl/pfctl.c
r85dd332 r4831944 34 34 */ 35 35 36 #ifdef __rtems__ 37 #include <machine/rtems-bsd-program.h> 38 39 #define __need_getopt_newlib 40 #include <getopt.h> 41 42 /* We need some functions from kernel space. */ 43 #define pf_get_ruleset_number _bsd_pf_get_ruleset_number 44 #define pf_init_ruleset _bsd_pf_init_ruleset 45 46 #include <rtems/linkersets.h> 47 #include <machine/rtems-bsd-commands.h> 48 #endif /* __rtems__ */ 36 49 #include <sys/cdefs.h> 37 50 __FBSDID("$FreeBSD$"); … … 293 306 usage(void) 294 307 { 308 #ifndef __rtems__ 295 309 extern char *__progname; 310 #else /* __rtems__ */ 311 #define __progname "pfctl" 312 #endif /* __rtems__ */ 296 313 297 314 fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname); … … 1646 1663 pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT; 1647 1664 1665 #ifndef __rtems__ 1648 1666 mib[0] = CTL_HW; 1649 1667 #ifdef __FreeBSD__ … … 1656 1674 err(1, "sysctl"); 1657 1675 if (mem <= 100*1024*1024) 1676 #endif /* __rtems__ */ 1658 1677 pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT_SMALL; 1659 1678 … … 2070 2089 } 2071 2090 2091 #ifdef __rtems__ 2092 static int main(int argc, char *argv[]); 2093 2094 RTEMS_LINKER_RWSET(bsd_prog_pfctl, char); 2095 2096 int 2097 rtems_bsd_command_pfctl(int argc, char *argv[]) 2098 { 2099 int exit_code = EXIT_FAILURE; 2100 const void *data_buf = RTEMS_LINKER_SET_BEGIN(bsd_prog_pfctl); 2101 const size_t data_size = RTEMS_LINKER_SET_SIZE(bsd_prog_pfctl); 2102 2103 rtems_bsd_program_lock(); 2104 exit_code = rtems_bsd_program_call_main_with_data_restore("pfctl", 2105 main, argc, argv, data_buf, data_size); 2106 rtems_bsd_program_unlock(); 2107 2108 return exit_code; 2109 } 2110 2111 #endif /* __rtems__ */ 2072 2112 int 2073 2113 main(int argc, char *argv[]) … … 2080 2120 char anchorname[MAXPATHLEN]; 2081 2121 char *path; 2122 2123 #ifdef __rtems__ 2124 struct getopt_data getopt_data; 2125 memset(&getopt_data, 0, sizeof(getopt_data)); 2126 #define optind getopt_data.optind 2127 #define optarg getopt_data.optarg 2128 #define opterr getopt_data.opterr 2129 #define optopt getopt_data.optopt 2130 #define getopt(argc, argv, opt) getopt_r(argc, argv, "+" opt, &getopt_data) 2131 #endif /* __rtems__ */ 2082 2132 2083 2133 if (argc < 2) … … 2472 2522 exit(error); 2473 2523 } 2524 #ifdef __rtems__ 2525 #include "pfctl-data.h" 2526 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_altq.c
r85dd332 r4831944 21 21 */ 22 22 23 #ifdef __rtems__ 24 #include <machine/rtems-bsd-program.h> 25 #endif /* __rtems__ */ 23 26 #include <sys/cdefs.h> 24 27 __FBSDID("$FreeBSD$"); … … 1277 1280 printf(")"); 1278 1281 } 1282 #ifdef __rtems__ 1283 #include "pfctl_altq-data.h" 1284 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_optimize.c
r85dd332 r4831944 19 19 */ 20 20 21 #ifdef __rtems__ 22 #include <machine/rtems-bsd-program.h> 23 24 /* We need some functions from kernel space. */ 25 #define pf_find_or_create_ruleset _bsd_pf_find_or_create_ruleset 26 #endif /* __rtems__ */ 21 27 #include <sys/cdefs.h> 22 28 __FBSDID("$FreeBSD$"); … … 1693 1699 free(block); 1694 1700 } 1695 1701 #ifdef __rtems__ 1702 #include "pfctl_optimize-data.h" 1703 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_osfp.c
r85dd332 r4831944 19 19 */ 20 20 21 #ifdef __rtems__ 22 #include <machine/rtems-bsd-program.h> 23 #endif /* __rtems__ */ 21 24 #include <rtems/bsd/sys/types.h> 22 25 #include <sys/ioctl.h> … … 1126 1129 return (buf); 1127 1130 } 1131 #ifdef __rtems__ 1132 #include "pfctl_osfp-data.h" 1133 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_parser.c
r85dd332 r4831944 34 34 */ 35 35 36 #ifdef __rtems__ 37 #include <machine/rtems-bsd-program.h> 38 #endif /* __rtems__ */ 36 39 #include <sys/cdefs.h> 37 40 __FBSDID("$FreeBSD$"); … … 41 44 #include <sys/socket.h> 42 45 #include <rtems/bsd/sys/param.h> 46 #ifdef __rtems__ 47 #include <rtems/bsd/sys/errno.h> 48 #endif /* __rtems__ */ 43 49 #include <sys/proc.h> 44 50 #include <net/if.h> … … 1768 1774 return ioctl(dev, cmd, &trans); 1769 1775 } 1776 #ifdef __rtems__ 1777 #include "pfctl_parser-data.h" 1778 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_qstats.c
r85dd332 r4831944 19 19 */ 20 20 21 #ifdef __rtems__ 22 #include <machine/rtems-bsd-program.h> 23 #endif /* __rtems__ */ 21 24 #include <sys/cdefs.h> 22 25 __FBSDID("$FreeBSD$"); … … 456 459 qs->avgn++; 457 460 } 461 #ifdef __rtems__ 462 #include "pfctl_qstats-data.h" 463 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_radix.c
r85dd332 r4831944 33 33 */ 34 34 35 #ifdef __rtems__ 36 #include <machine/rtems-bsd-program.h> 37 #endif /* __rtems__ */ 35 38 #include <sys/cdefs.h> 36 39 __FBSDID("$FreeBSD$"); … … 49 52 #include <stdlib.h> 50 53 #include <limits.h> 54 #ifdef __rtems__ 55 #define SIZE_T_MAX SIZE_MAX 56 #endif /* __rtems__ */ 51 57 #include <err.h> 52 58 … … 595 601 } 596 602 } 603 #ifdef __rtems__ 604 #include "pfctl_radix-data.h" 605 #endif /* __rtems__ */ -
freebsd/contrib/pf/pfctl/pfctl_table.c
r85dd332 r4831944 33 33 */ 34 34 35 #ifdef __rtems__ 36 #include <machine/rtems-bsd-program.h> 37 #endif /* __rtems__ */ 35 38 #include <sys/cdefs.h> 36 39 __FBSDID("$FreeBSD$"); … … 496 499 radix_perror(void) 497 500 { 501 #ifndef __rtems__ 498 502 extern char *__progname; 503 #else /* __rtems__ */ 504 #define __progname "pfctl" 505 #endif /* __rtems__ */ 499 506 fprintf(stderr, "%s: %s.\n", __progname, pfr_strerror(errno)); 500 507 }
Note: See TracChangeset
for help on using the changeset viewer.