Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f02f47407 | ||
|
|
54777d3fd9 | ||
|
|
67faaf25d2 | ||
|
|
f4150f12fe |
@@ -24,6 +24,9 @@
|
|||||||
# Directory: <ProjectName>.cache/ - regenerated by Vivado
|
# Directory: <ProjectName>.cache/ - regenerated by Vivado
|
||||||
*.cache/
|
*.cache/
|
||||||
|
|
||||||
|
# ----- Logs -----
|
||||||
|
*.log
|
||||||
|
|
||||||
# ----- Vivado Generated Sources -----
|
# ----- Vivado Generated Sources -----
|
||||||
# Directory: <ProjectName>.gen/ - keep HDL, ignore sim files
|
# Directory: <ProjectName>.gen/ - keep HDL, ignore sim files
|
||||||
*.gen/*/ip/*/sim/
|
*.gen/*/ip/*/sim/
|
||||||
|
|||||||
@@ -1,845 +0,0 @@
|
|||||||
|
|
||||||
*** Running vivado
|
|
||||||
with args -log system_wrapper.vdi -applog -m64 -product Vivado -messageDb vivado.pb -mode batch -source system_wrapper.tcl -notrace
|
|
||||||
|
|
||||||
|
|
||||||
****** Vivado v2023.2 (64-bit)
|
|
||||||
**** SW Build 4029153 on Fri Oct 13 20:13:54 MDT 2023
|
|
||||||
**** IP Build 4028589 on Sat Oct 14 00:45:43 MDT 2023
|
|
||||||
**** SharedData Build 4025554 on Tue Oct 10 17:18:54 MDT 2023
|
|
||||||
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
|
|
||||||
** Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
|
||||||
|
|
||||||
source system_wrapper.tcl -notrace
|
|
||||||
INFO: [IP_Flow 19-234] Refreshing IP repositories
|
|
||||||
INFO: [IP_Flow 19-1704] No user IP repositories specified
|
|
||||||
INFO: [IP_Flow 19-2313] Loaded Vivado IP repository '/data/xilinx/Vivado/2023.2/data/ip'.
|
|
||||||
Command: link_design -top system_wrapper -part xc7z035ffg676-2
|
|
||||||
Design is defaulting to srcset: sources_1
|
|
||||||
Design is defaulting to constrset: constrs_1
|
|
||||||
INFO: [Device 21-403] Loading part xc7z035ffg676-2
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 1722.395 ; gain = 0.000 ; free physical = 1995 ; free virtual = 71203
|
|
||||||
INFO: [Netlist 29-17] Analyzing 39 Unisim elements for replacement
|
|
||||||
INFO: [Netlist 29-28] Unisim Transformation completed in 0 CPU seconds
|
|
||||||
INFO: [Project 1-479] Netlist was created with Vivado 2023.2
|
|
||||||
INFO: [Project 1-570] Preparing netlist for logic optimization
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/system_processing_system7_0_0.xdc] for cell 'system_i/processing_system7_0/inst'
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/system_processing_system7_0_0.xdc] for cell 'system_i/processing_system7_0/inst'
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1_board.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1_board.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
WARNING: [Vivado_Tcl 4-921] Waiver ID 'CDC-11' -to list should not be empty. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc:50]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_cons.xdc]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_cons.xdc]
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc]
|
|
||||||
INFO: [Opt 31-138] Pushed 0 inverter(s) to 0 load pin(s).
|
|
||||||
INFO: [Project 1-1687] 1 scoped IP constraints or related sub-commands were skipped due to synthesis logic optimizations usually triggered by constant connectivity or unconnected output pins. To review the skipped constraints and messages, run the command 'set_param netlist.IPMsgFiltering false' before opening the design.
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 2307.883 ; gain = 0.000 ; free physical = 1722 ; free virtual = 70993
|
|
||||||
INFO: [Project 1-111] Unisim Transformation Summary:
|
|
||||||
A total of 33 instances were transformed.
|
|
||||||
IOBUF => IOBUF (IBUF, OBUFT): 33 instances
|
|
||||||
|
|
||||||
11 Infos, 1 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
link_design completed successfully
|
|
||||||
link_design: Time (s): cpu = 00:00:07 ; elapsed = 00:00:07 . Memory (MB): peak = 2307.883 ; gain = 962.004 ; free physical = 1730 ; free virtual = 71000
|
|
||||||
Command: opt_design
|
|
||||||
Attempting to get a license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-349] Got license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
Running DRC as a precondition to command opt_design
|
|
||||||
|
|
||||||
Starting DRC Task
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Project 1-461] DRC finished with 0 Errors
|
|
||||||
INFO: [Project 1-462] Please refer to the DRC report (report_drc) for more information.
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.59 ; elapsed = 00:00:00.36 . Memory (MB): peak = 2307.883 ; gain = 0.000 ; free physical = 1727 ; free virtual = 71012
|
|
||||||
|
|
||||||
Starting Cache Timing Information Task
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
Ending Cache Timing Information Task | Checksum: 2382775f8
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:03 ; elapsed = 00:00:03 . Memory (MB): peak = 2762.520 ; gain = 454.637 ; free physical = 1293 ; free virtual = 70618
|
|
||||||
|
|
||||||
Starting Logic Optimization Task
|
|
||||||
|
|
||||||
Phase 1 Initialization
|
|
||||||
|
|
||||||
Phase 1.1 Core Generation And Design Setup
|
|
||||||
|
|
||||||
Phase 1.1.1 Generate And Synthesize Debug Cores
|
|
||||||
INFO: [Chipscope 16-329] Generating Script for core instance : dbg_hub
|
|
||||||
INFO: [IP_Flow 19-3806] Processing IP xilinx.com:ip:xsdbm:3.0 for cell dbg_hub_CV.
|
|
||||||
INFO: [Chipscope 16-329] Generating Script for core instance : u_ila_0
|
|
||||||
INFO: [IP_Flow 19-3806] Processing IP xilinx.com:ip:ila:6.2 for cell u_ila_0_CV.
|
|
||||||
Done building netlist checker database: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 3095.020 ; gain = 0.000 ; free physical = 9128 ; free virtual = 68708
|
|
||||||
Done building netlist checker database: Time (s): cpu = 00:00:00.01 ; elapsed = 00:00:00.01 . Memory (MB): peak = 3201.777 ; gain = 0.000 ; free physical = 8923 ; free virtual = 68563
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.24 ; elapsed = 00:00:00.24 . Memory (MB): peak = 3378.160 ; gain = 0.000 ; free physical = 8306 ; free virtual = 68085
|
|
||||||
Phase 1.1.1 Generate And Synthesize Debug Cores | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:04 ; elapsed = 00:03:16 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8306 ; free virtual = 68085
|
|
||||||
Phase 1.1 Core Generation And Design Setup | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:04 ; elapsed = 00:03:16 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8306 ; free virtual = 68085
|
|
||||||
|
|
||||||
Phase 1.2 Setup Constraints And Sort Netlist
|
|
||||||
Phase 1.2 Setup Constraints And Sort Netlist | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:04 ; elapsed = 00:03:16 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8306 ; free virtual = 68086
|
|
||||||
Phase 1 Initialization | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:04 ; elapsed = 00:03:16 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8300 ; free virtual = 68083
|
|
||||||
|
|
||||||
Phase 2 Timer Update And Timing Data Collection
|
|
||||||
|
|
||||||
Phase 2.1 Timer Update
|
|
||||||
Phase 2.1 Timer Update | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:06 ; elapsed = 00:03:16 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8296 ; free virtual = 68078
|
|
||||||
|
|
||||||
Phase 2.2 Timing Data Collection
|
|
||||||
Phase 2.2 Timing Data Collection | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:06 ; elapsed = 00:03:17 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8279 ; free virtual = 68065
|
|
||||||
Phase 2 Timer Update And Timing Data Collection | Checksum: 1a85f7bbe
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:06 ; elapsed = 00:03:17 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8279 ; free virtual = 68065
|
|
||||||
|
|
||||||
Phase 3 Retarget
|
|
||||||
INFO: [Opt 31-138] Pushed 1 inverter(s) to 1 load pin(s).
|
|
||||||
INFO: [Opt 31-49] Retargeted 0 cell(s).
|
|
||||||
Phase 3 Retarget | Checksum: 20e292eaa
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:07 ; elapsed = 00:03:17 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8270 ; free virtual = 68062
|
|
||||||
Retarget | Checksum: 20e292eaa
|
|
||||||
INFO: [Opt 31-389] Phase Retarget created 4 cells and removed 35 cells
|
|
||||||
INFO: [Opt 31-1021] In phase Retarget, 99 netlist objects are constrained preventing optimization. Please run opt_design with -debug_log to get more detail.
|
|
||||||
|
|
||||||
Phase 4 Constant propagation
|
|
||||||
INFO: [Opt 31-138] Pushed 0 inverter(s) to 0 load pin(s).
|
|
||||||
Phase 4 Constant propagation | Checksum: 1fb9c5663
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:07 ; elapsed = 00:03:17 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8271 ; free virtual = 68063
|
|
||||||
Constant propagation | Checksum: 1fb9c5663
|
|
||||||
INFO: [Opt 31-389] Phase Constant propagation created 0 cells and removed 16 cells
|
|
||||||
INFO: [Opt 31-1021] In phase Constant propagation, 49 netlist objects are constrained preventing optimization. Please run opt_design with -debug_log to get more detail.
|
|
||||||
|
|
||||||
Phase 5 Sweep
|
|
||||||
Phase 5 Sweep | Checksum: 1dd19d44b
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:08 ; elapsed = 00:03:18 . Memory (MB): peak = 3378.160 ; gain = 312.891 ; free physical = 8274 ; free virtual = 68074
|
|
||||||
Sweep | Checksum: 1dd19d44b
|
|
||||||
INFO: [Opt 31-389] Phase Sweep created 0 cells and removed 46 cells
|
|
||||||
INFO: [Opt 31-1021] In phase Sweep, 956 netlist objects are constrained preventing optimization. Please run opt_design with -debug_log to get more detail.
|
|
||||||
|
|
||||||
Phase 6 BUFG optimization
|
|
||||||
INFO: [Opt 31-194] Inserted BUFG system_i/dna_port_read_0/inst/read_vld_BUFG_inst to drive 57 load(s) on clock net system_i/dna_port_read_0/inst/read_vld_BUFG
|
|
||||||
INFO: [Opt 31-193] Inserted 1 BUFG(s) on clock nets
|
|
||||||
Phase 6 BUFG optimization | Checksum: 202feca59
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8266 ; free virtual = 68070
|
|
||||||
BUFG optimization | Checksum: 202feca59
|
|
||||||
INFO: [Opt 31-662] Phase BUFG optimization created 1 cells of which 1 are BUFGs and removed 0 cells.
|
|
||||||
|
|
||||||
Phase 7 Shift Register Optimization
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_CDONE/I_YESLUT6.U_SRL32_A due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_CDONE/I_YESLUT6.U_SRL32_B due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS0/I_YESLUT6.U_SRL32_A due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS0/I_YESLUT6.U_SRL32_B due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS0/I_YESLUT6.U_SRL32_C due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS0/I_YESLUT6.U_SRL32_D due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS1/I_YESLUT6.U_SRL32_A due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS1/I_YESLUT6.U_SRL32_B due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS1/I_YESLUT6.U_SRL32_C due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/U_NS1/I_YESLUT6.U_SRL32_D due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/U_CMPRESET/I_YESLUT6.U_SRL32_A due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/U_CMPRESET/I_YESLUT6.U_SRL32_B due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_window_counter/U_WCE/I_YESLUT6.U_SRLC16E due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_window_counter/U_WHCMPCE/I_YESLUT6.U_SRL32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_window_counter/U_WLCMPCE/I_YESLUT6.U_SRL32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_sample_counter/U_SCE/I_YESLUT6.U_SRLC16E due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_sample_counter/U_SCMPCE/I_YESLUT6.U_SRL32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_sample_counter/U_SCRST/I_YESLUT6.U_SRL32_A due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from u_ila_0/inst/ila_core_inst/u_ila_cap_ctrl/u_cap_addrgen/u_cap_sample_counter/U_SCRST/I_YESLUT6.U_SRL32_B due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][0]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][10]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][11]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][12]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][13]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][14]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][15]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][16]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][17]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][18]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][19]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][1]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][20]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][21]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][22]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][23]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][24]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][25]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][26]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][27]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][28]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][29]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][2]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][30]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][31]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][3]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][4]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][5]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][6]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][7]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][8]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/rd_data_fifo_0/memory_reg[31][9]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][0]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][10]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][11]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][12]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][1]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][2]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][3]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][4]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][5]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][6]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][7]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][8]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/RD.r_channel_0/transaction_fifo_0/memory_reg[31][9]_srl32 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][0]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][10]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][11]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][12]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][13]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][14]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][15]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][16]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][17]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][18]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][19]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][1]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][2]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][3]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][8]_srl4 due to none static srl address bits
|
|
||||||
WARNING: [Opt 31-1131] Can not pull register out from system_i/ps7_0_axi_periph/s00_couplers/auto_pc/inst/gen_axilite.gen_b2s_conv.axilite_b2s/WR.b_channel_0/bid_fifo_0/memory_reg[3][9]_srl4 due to none static srl address bits
|
|
||||||
INFO: [Opt 31-1064] SRL Remap converted 0 SRLs to 0 registers and converted 0 registers of register chains to 0 SRLs
|
|
||||||
Phase 7 Shift Register Optimization | Checksum: 202feca59
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8263 ; free virtual = 68069
|
|
||||||
Shift Register Optimization | Checksum: 202feca59
|
|
||||||
INFO: [Opt 31-389] Phase Shift Register Optimization created 0 cells and removed 0 cells
|
|
||||||
|
|
||||||
Phase 8 Post Processing Netlist
|
|
||||||
Phase 8 Post Processing Netlist | Checksum: 202feca59
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8260 ; free virtual = 68067
|
|
||||||
Post Processing Netlist | Checksum: 202feca59
|
|
||||||
INFO: [Opt 31-389] Phase Post Processing Netlist created 0 cells and removed 0 cells
|
|
||||||
INFO: [Opt 31-1021] In phase Post Processing Netlist, 57 netlist objects are constrained preventing optimization. Please run opt_design with -debug_log to get more detail.
|
|
||||||
|
|
||||||
Phase 9 Finalization
|
|
||||||
|
|
||||||
Phase 9.1 Finalizing Design Cores and Updating Shapes
|
|
||||||
Phase 9.1 Finalizing Design Cores and Updating Shapes | Checksum: 2572a104c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8258 ; free virtual = 68070
|
|
||||||
|
|
||||||
Phase 9.2 Verifying Netlist Connectivity
|
|
||||||
|
|
||||||
Starting Connectivity Check Task
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.09 ; elapsed = 00:00:00.09 . Memory (MB): peak = 3442.176 ; gain = 0.000 ; free physical = 8255 ; free virtual = 68068
|
|
||||||
Phase 9.2 Verifying Netlist Connectivity | Checksum: 2572a104c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8255 ; free virtual = 68068
|
|
||||||
Phase 9 Finalization | Checksum: 2572a104c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8255 ; free virtual = 68068
|
|
||||||
Opt_design Change Summary
|
|
||||||
=========================
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
| Phase | #Cells created | #Cells Removed | #Constrained objects preventing optimizations |
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
| Retarget | 4 | 35 | 99 |
|
|
||||||
| Constant propagation | 0 | 16 | 49 |
|
|
||||||
| Sweep | 0 | 46 | 956 |
|
|
||||||
| BUFG optimization | 1 | 0 | 0 |
|
|
||||||
| Shift Register Optimization | 0 | 0 | 0 |
|
|
||||||
| Post Processing Netlist | 0 | 0 | 57 |
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
Ending Logic Optimization Task | Checksum: 2572a104c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:03:09 ; elapsed = 00:03:19 . Memory (MB): peak = 3442.176 ; gain = 376.906 ; free physical = 8254 ; free virtual = 68068
|
|
||||||
INFO: [Constraints 18-11670] Building netlist checker database with flags, 0x8
|
|
||||||
Done building netlist checker database: Time (s): cpu = 00:00:00.03 ; elapsed = 00:00:00.03 . Memory (MB): peak = 3442.176 ; gain = 0.000 ; free physical = 8253 ; free virtual = 68067
|
|
||||||
|
|
||||||
Starting Power Optimization Task
|
|
||||||
INFO: [Pwropt 34-132] Skipping clock gating for clocks with a period < 2.00 ns.
|
|
||||||
INFO: [Power 33-23] Power model is not available for DNA_PORT_inst
|
|
||||||
INFO: [Pwropt 34-9] Applying IDT optimizations ...
|
|
||||||
INFO: [Pwropt 34-10] Applying ODC optimizations ...
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
Running Vector-less Activity Propagation...
|
|
||||||
|
|
||||||
Finished Running Vector-less Activity Propagation
|
|
||||||
|
|
||||||
|
|
||||||
Starting PowerOpt Patch Enables Task
|
|
||||||
INFO: [Pwropt 34-162] WRITE_MODE attribute of 0 BRAM(s) out of a total of 3 has been updated to save power. Run report_power_opt to get a complete listing of the BRAMs updated.
|
|
||||||
INFO: [Pwropt 34-201] Structural ODC has moved 0 WE to EN ports
|
|
||||||
Number of BRAM Ports augmented: 3 newly gated: 0 Total Ports: 6
|
|
||||||
Ending PowerOpt Patch Enables Task | Checksum: 1c6a995af
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.24 ; elapsed = 00:00:00.24 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7922 ; free virtual = 67775
|
|
||||||
Ending Power Optimization Task | Checksum: 1c6a995af
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:11 ; elapsed = 00:00:04 . Memory (MB): peak = 3998.043 ; gain = 555.867 ; free physical = 7922 ; free virtual = 67775
|
|
||||||
|
|
||||||
Starting Final Cleanup Task
|
|
||||||
Ending Final Cleanup Task | Checksum: 1c6a995af
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.01 ; elapsed = 00:00:00.01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7922 ; free virtual = 67774
|
|
||||||
|
|
||||||
Starting Netlist Obfuscation Task
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7921 ; free virtual = 67776
|
|
||||||
Ending Netlist Obfuscation Task | Checksum: 1b06a1b26
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.03 ; elapsed = 00:00:00.03 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7921 ; free virtual = 67776
|
|
||||||
INFO: [Common 17-83] Releasing license: Implementation
|
|
||||||
54 Infos, 82 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
opt_design completed successfully
|
|
||||||
opt_design: Time (s): cpu = 00:03:26 ; elapsed = 00:03:28 . Memory (MB): peak = 3998.043 ; gain = 1690.160 ; free physical = 7921 ; free virtual = 67776
|
|
||||||
INFO: [runtcl-4] Executing : report_drc -file system_wrapper_drc_opted.rpt -pb system_wrapper_drc_opted.pb -rpx system_wrapper_drc_opted.rpx
|
|
||||||
Command: report_drc -file system_wrapper_drc_opted.rpt -pb system_wrapper_drc_opted.pb -rpx system_wrapper_drc_opted.rpx
|
|
||||||
INFO: [IP_Flow 19-1839] IP Catalog is up to date.
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 2-168] The results of DRC are in file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_drc_opted.rpt.
|
|
||||||
report_drc completed successfully
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
INFO: [Timing 38-480] Writing timing data to binary archive.
|
|
||||||
Wrote PlaceDB: Time (s): cpu = 00:00:00.04 ; elapsed = 00:00:00 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7766 ; free virtual = 67648
|
|
||||||
Wrote PulsedLatchDB: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7766 ; free virtual = 67648
|
|
||||||
Writing XDEF routing.
|
|
||||||
Writing XDEF routing logical nets.
|
|
||||||
Write ShapeDB Complete: Time (s): cpu = 00:00:00.27 ; elapsed = 00:00:00.05 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7763 ; free virtual = 67652
|
|
||||||
Writing XDEF routing special nets.
|
|
||||||
Wrote RouteStorage: Time (s): cpu = 00:00:00.33 ; elapsed = 00:00:00.07 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7763 ; free virtual = 67653
|
|
||||||
Wrote Netlist Cache: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7763 ; free virtual = 67653
|
|
||||||
Wrote Device Cache: Time (s): cpu = 00:00:00.04 ; elapsed = 00:00:00.01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7763 ; free virtual = 67654
|
|
||||||
Write Physdb Complete: Time (s): cpu = 00:00:00.43 ; elapsed = 00:00:00.09 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7763 ; free virtual = 67654
|
|
||||||
INFO: [Common 17-1381] The checkpoint '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_opt.dcp' has been generated.
|
|
||||||
INFO: [Chipscope 16-240] Debug cores have already been implemented
|
|
||||||
Command: place_design
|
|
||||||
Attempting to get a license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-349] Got license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-83] Releasing license: Implementation
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 4-198] DRC finished with 0 Errors
|
|
||||||
INFO: [Vivado_Tcl 4-199] Please refer to the DRC report (report_drc) for more information.
|
|
||||||
Running DRC as a precondition to command place_design
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 4-198] DRC finished with 0 Errors
|
|
||||||
INFO: [Vivado_Tcl 4-199] Please refer to the DRC report (report_drc) for more information.
|
|
||||||
INFO: [Place 30-611] Multithreading enabled for place_design using a maximum of 8 CPUs
|
|
||||||
|
|
||||||
Starting Placer Task
|
|
||||||
|
|
||||||
Phase 1 Placer Initialization
|
|
||||||
|
|
||||||
Phase 1.1 Placer Initialization Netlist Sorting
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7612 ; free virtual = 67560
|
|
||||||
Phase 1.1 Placer Initialization Netlist Sorting | Checksum: 19758bd7a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:00.03 ; elapsed = 00:00:00.04 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7612 ; free virtual = 67559
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7611 ; free virtual = 67559
|
|
||||||
|
|
||||||
Phase 1.2 IO Placement/ Clock Placement/ Build Placer Device
|
|
||||||
Phase 1.2 IO Placement/ Clock Placement/ Build Placer Device | Checksum: 8751fbf6
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:03 ; elapsed = 00:00:02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7587 ; free virtual = 67558
|
|
||||||
|
|
||||||
Phase 1.3 Build Placer Netlist Model
|
|
||||||
Phase 1.3 Build Placer Netlist Model | Checksum: dd0b0e99
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:16 ; elapsed = 00:00:09 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7431 ; free virtual = 67481
|
|
||||||
|
|
||||||
Phase 1.4 Constrain Clocks/Macros
|
|
||||||
Phase 1.4 Constrain Clocks/Macros | Checksum: dd0b0e99
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:16 ; elapsed = 00:00:09 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7428 ; free virtual = 67479
|
|
||||||
Phase 1 Placer Initialization | Checksum: dd0b0e99
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:16 ; elapsed = 00:00:09 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7428 ; free virtual = 67479
|
|
||||||
|
|
||||||
Phase 2 Global Placement
|
|
||||||
|
|
||||||
Phase 2.1 Floorplanning
|
|
||||||
Phase 2.1 Floorplanning | Checksum: eecb6848
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:20 ; elapsed = 00:00:11 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7404 ; free virtual = 67474
|
|
||||||
|
|
||||||
Phase 2.2 Update Timing before SLR Path Opt
|
|
||||||
Phase 2.2 Update Timing before SLR Path Opt | Checksum: db55687b
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:23 ; elapsed = 00:00:12 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7407 ; free virtual = 67493
|
|
||||||
|
|
||||||
Phase 2.3 Post-Processing in Floorplanning
|
|
||||||
Phase 2.3 Post-Processing in Floorplanning | Checksum: db55687b
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:24 ; elapsed = 00:00:12 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7401 ; free virtual = 67488
|
|
||||||
|
|
||||||
Phase 2.4 Global Placement Core
|
|
||||||
|
|
||||||
Phase 2.4.1 UpdateTiming Before Physical Synthesis
|
|
||||||
Phase 2.4.1 UpdateTiming Before Physical Synthesis | Checksum: 1e9ca9de9
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:54 ; elapsed = 00:00:25 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7017 ; free virtual = 67264
|
|
||||||
|
|
||||||
Phase 2.4.2 Physical Synthesis In Placer
|
|
||||||
INFO: [Physopt 32-1035] Found 0 LUTNM shape to break, 1172 LUT instances to create LUTNM shape
|
|
||||||
INFO: [Physopt 32-1044] Break lutnm for timing: one critical 0, two critical 0, total 0, new lutff created 0
|
|
||||||
INFO: [Physopt 32-1138] End 1 Pass. Optimized 565 nets or LUTs. Breaked 0 LUT, combined 565 existing LUTs and moved 0 existing LUT
|
|
||||||
INFO: [Physopt 32-65] No nets found for high-fanout optimization.
|
|
||||||
INFO: [Physopt 32-232] Optimized 0 net. Created 0 new instance.
|
|
||||||
INFO: [Physopt 32-775] End 1 Pass. Optimized 0 net or cell. Created 0 new cell, deleted 0 existing cell and moved 0 existing cell
|
|
||||||
INFO: [Physopt 32-670] No setup violation found. DSP Register Optimization was not performed.
|
|
||||||
INFO: [Physopt 32-670] No setup violation found. Shift Register to Pipeline Optimization was not performed.
|
|
||||||
INFO: [Physopt 32-670] No setup violation found. Shift Register Optimization was not performed.
|
|
||||||
INFO: [Physopt 32-670] No setup violation found. BRAM Register Optimization was not performed.
|
|
||||||
INFO: [Physopt 32-670] No setup violation found. URAM Register Optimization was not performed.
|
|
||||||
INFO: [Physopt 32-949] No candidate nets found for dynamic/static region interface net replication
|
|
||||||
INFO: [Physopt 32-775] End 1 Pass. Optimized 0 net or cell. Created 0 new cell, deleted 0 existing cell and moved 0 existing cell
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.03 ; elapsed = 00:00:00.02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7022 ; free virtual = 67279
|
|
||||||
|
|
||||||
Summary of Physical Synthesis Optimizations
|
|
||||||
============================================
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
| Optimization | Added Cells | Removed Cells | Optimized Cells/Nets | Dont Touch | Iterations | Elapsed |
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
| LUT Combining | 0 | 565 | 565 | 0 | 1 | 00:00:00 |
|
|
||||||
| Retime | 0 | 0 | 0 | 0 | 1 | 00:00:00 |
|
|
||||||
| Very High Fanout | 0 | 0 | 0 | 0 | 1 | 00:00:00 |
|
|
||||||
| DSP Register | 0 | 0 | 0 | 0 | 0 | 00:00:00 |
|
|
||||||
| Shift Register to Pipeline | 0 | 0 | 0 | 0 | 0 | 00:00:00 |
|
|
||||||
| Shift Register | 0 | 0 | 0 | 0 | 0 | 00:00:00 |
|
|
||||||
| BRAM Register | 0 | 0 | 0 | 0 | 0 | 00:00:00 |
|
|
||||||
| URAM Register | 0 | 0 | 0 | 0 | 0 | 00:00:00 |
|
|
||||||
| Dynamic/Static Region Interface Net Replication | 0 | 0 | 0 | 0 | 1 | 00:00:00 |
|
|
||||||
| Total | 0 | 565 | 565 | 0 | 4 | 00:00:01 |
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
Phase 2.4.2 Physical Synthesis In Placer | Checksum: 2be40b2db
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:59 ; elapsed = 00:00:28 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7014 ; free virtual = 67290
|
|
||||||
Phase 2.4 Global Placement Core | Checksum: 2859c5ffd
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:01 ; elapsed = 00:00:29 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7011 ; free virtual = 67293
|
|
||||||
Phase 2 Global Placement | Checksum: 2859c5ffd
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:01 ; elapsed = 00:00:29 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7011 ; free virtual = 67293
|
|
||||||
|
|
||||||
Phase 3 Detail Placement
|
|
||||||
|
|
||||||
Phase 3.1 Commit Multi Column Macros
|
|
||||||
Phase 3.1 Commit Multi Column Macros | Checksum: 1ea091a8d
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:05 ; elapsed = 00:00:30 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 7007 ; free virtual = 67305
|
|
||||||
|
|
||||||
Phase 3.2 Commit Most Macros & LUTRAMs
|
|
||||||
Phase 3.2 Commit Most Macros & LUTRAMs | Checksum: 29969cf51
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:13 ; elapsed = 00:00:35 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6986 ; free virtual = 67345
|
|
||||||
|
|
||||||
Phase 3.3 Area Swap Optimization
|
|
||||||
Phase 3.3 Area Swap Optimization | Checksum: 2b62d77e5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:14 ; elapsed = 00:00:35 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6984 ; free virtual = 67343
|
|
||||||
|
|
||||||
Phase 3.4 Pipeline Register Optimization
|
|
||||||
Phase 3.4 Pipeline Register Optimization | Checksum: 1ed299be3
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:14 ; elapsed = 00:00:35 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6982 ; free virtual = 67342
|
|
||||||
|
|
||||||
Phase 3.5 Small Shape Detail Placement
|
|
||||||
|
|
||||||
Phase 3.5.1 Place Remaining
|
|
||||||
Phase 3.5.1 Place Remaining | Checksum: 21b5bb37c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:20 ; elapsed = 00:00:41 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6918 ; free virtual = 67346
|
|
||||||
Phase 3.5 Small Shape Detail Placement | Checksum: 21b5bb37c
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:20 ; elapsed = 00:00:41 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6849 ; free virtual = 67281
|
|
||||||
|
|
||||||
Phase 3.6 Re-assign LUT pins
|
|
||||||
Phase 3.6 Re-assign LUT pins | Checksum: 1a6b845f5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:21 ; elapsed = 00:00:42 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6838 ; free virtual = 67277
|
|
||||||
|
|
||||||
Phase 3.7 Pipeline Register Optimization
|
|
||||||
Phase 3.7 Pipeline Register Optimization | Checksum: 1a81ce610
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:21 ; elapsed = 00:00:42 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6834 ; free virtual = 67277
|
|
||||||
Phase 3 Detail Placement | Checksum: 1a81ce610
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:21 ; elapsed = 00:00:42 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6828 ; free virtual = 67276
|
|
||||||
|
|
||||||
Phase 4 Post Placement Optimization and Clean-Up
|
|
||||||
|
|
||||||
Phase 4.1 Post Commit Optimization
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
|
|
||||||
Phase 4.1.1 Post Placement Optimization
|
|
||||||
Post Placement Optimization Initialization | Checksum: 1472dfedc
|
|
||||||
|
|
||||||
Phase 4.1.1.1 BUFG Insertion
|
|
||||||
|
|
||||||
Starting Physical Synthesis Task
|
|
||||||
|
|
||||||
Phase 1 Physical Synthesis Initialization
|
|
||||||
INFO: [Physopt 32-721] Multithreading enabled for phys_opt_design using a maximum of 8 CPUs
|
|
||||||
INFO: [Physopt 32-619] Estimated Timing Summary | WNS=2.626 | TNS=0.000 |
|
|
||||||
Phase 1 Physical Synthesis Initialization | Checksum: a925bbef
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:03 ; elapsed = 00:00:01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6782 ; free virtual = 67315
|
|
||||||
INFO: [Place 46-56] BUFG insertion identified 0 candidate nets. Inserted BUFG: 0, Replicated BUFG Driver: 0, Skipped due to Placement/Routing Conflicts: 0, Skipped due to Timing Degradation: 0, Skipped due to netlist editing failed: 0.
|
|
||||||
Ending Physical Synthesis Task | Checksum: a925bbef
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:04 ; elapsed = 00:00:02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6769 ; free virtual = 67309
|
|
||||||
Phase 4.1.1.1 BUFG Insertion | Checksum: 1472dfedc
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:38 ; elapsed = 00:00:50 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6768 ; free virtual = 67314
|
|
||||||
|
|
||||||
Phase 4.1.1.2 Post Placement Timing Optimization
|
|
||||||
INFO: [Place 30-746] Post Placement Timing Summary WNS=2.626. For the most accurate timing information please run report_timing.
|
|
||||||
Phase 4.1.1.2 Post Placement Timing Optimization | Checksum: 14f55351a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:39 ; elapsed = 00:00:51 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6755 ; free virtual = 67307
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:39 ; elapsed = 00:00:51 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6755 ; free virtual = 67307
|
|
||||||
Phase 4.1 Post Commit Optimization | Checksum: 14f55351a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:39 ; elapsed = 00:00:51 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6755 ; free virtual = 67307
|
|
||||||
|
|
||||||
Phase 4.2 Post Placement Cleanup
|
|
||||||
Phase 4.2 Post Placement Cleanup | Checksum: 14f55351a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:39 ; elapsed = 00:00:51 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6750 ; free virtual = 67308
|
|
||||||
|
|
||||||
Phase 4.3 Placer Reporting
|
|
||||||
|
|
||||||
Phase 4.3.1 Print Estimated Congestion
|
|
||||||
INFO: [Place 30-612] Post-Placement Estimated Congestion
|
|
||||||
____________________________________________________
|
|
||||||
| | Global Congestion | Short Congestion |
|
|
||||||
| Direction | Region Size | Region Size |
|
|
||||||
|___________|___________________|___________________|
|
|
||||||
| North| 2x2| 2x2|
|
|
||||||
|___________|___________________|___________________|
|
|
||||||
| South| 1x1| 1x1|
|
|
||||||
|___________|___________________|___________________|
|
|
||||||
| East| 1x1| 1x1|
|
|
||||||
|___________|___________________|___________________|
|
|
||||||
| West| 1x1| 1x1|
|
|
||||||
|___________|___________________|___________________|
|
|
||||||
|
|
||||||
Phase 4.3.1 Print Estimated Congestion | Checksum: 14f55351a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:40 ; elapsed = 00:00:52 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6748 ; free virtual = 67312
|
|
||||||
Phase 4.3 Placer Reporting | Checksum: 14f55351a
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:40 ; elapsed = 00:00:52 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6751 ; free virtual = 67321
|
|
||||||
|
|
||||||
Phase 4.4 Final Placement Cleanup
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6751 ; free virtual = 67321
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:40 ; elapsed = 00:00:52 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6751 ; free virtual = 67321
|
|
||||||
Phase 4 Post Placement Optimization and Clean-Up | Checksum: 19c30fa75
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:40 ; elapsed = 00:00:52 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6741 ; free virtual = 67314
|
|
||||||
Ending Placer Task | Checksum: dcf0239e
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:41 ; elapsed = 00:00:53 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6725 ; free virtual = 67298
|
|
||||||
90 Infos, 82 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
place_design completed successfully
|
|
||||||
place_design: Time (s): cpu = 00:01:44 ; elapsed = 00:00:54 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6725 ; free virtual = 67298
|
|
||||||
INFO: [runtcl-4] Executing : report_io -file system_wrapper_io_placed.rpt
|
|
||||||
report_io: Time (s): cpu = 00:00:00.06 ; elapsed = 00:00:00.06 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6722 ; free virtual = 67295
|
|
||||||
INFO: [runtcl-4] Executing : report_utilization -file system_wrapper_utilization_placed.rpt -pb system_wrapper_utilization_placed.pb
|
|
||||||
INFO: [runtcl-4] Executing : report_control_sets -verbose -file system_wrapper_control_sets_placed.rpt
|
|
||||||
report_control_sets: Time (s): cpu = 00:00:00.12 ; elapsed = 00:00:00.12 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6708 ; free virtual = 67293
|
|
||||||
INFO: [Timing 38-480] Writing timing data to binary archive.
|
|
||||||
Write ShapeDB Complete: Time (s): cpu = 00:00:00.43 ; elapsed = 00:00:00.09 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6731 ; free virtual = 67329
|
|
||||||
Wrote PlaceDB: Time (s): cpu = 00:00:03 ; elapsed = 00:00:01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6584 ; free virtual = 67235
|
|
||||||
Wrote PulsedLatchDB: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6584 ; free virtual = 67235
|
|
||||||
Writing XDEF routing.
|
|
||||||
Writing XDEF routing logical nets.
|
|
||||||
Writing XDEF routing special nets.
|
|
||||||
Wrote RouteStorage: Time (s): cpu = 00:00:00.2 ; elapsed = 00:00:00.07 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6584 ; free virtual = 67236
|
|
||||||
Wrote Netlist Cache: Time (s): cpu = 00:00:00.11 ; elapsed = 00:00:00.03 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6582 ; free virtual = 67237
|
|
||||||
Wrote Device Cache: Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6582 ; free virtual = 67238
|
|
||||||
Write Physdb Complete: Time (s): cpu = 00:00:04 ; elapsed = 00:00:01 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 6581 ; free virtual = 67237
|
|
||||||
INFO: [Common 17-1381] The checkpoint '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_placed.dcp' has been generated.
|
|
||||||
Command: route_design
|
|
||||||
Attempting to get a license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-349] Got license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
Running DRC as a precondition to command route_design
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 4-198] DRC finished with 0 Errors
|
|
||||||
INFO: [Vivado_Tcl 4-199] Please refer to the DRC report (report_drc) for more information.
|
|
||||||
|
|
||||||
|
|
||||||
Starting Routing Task
|
|
||||||
INFO: [Route 35-254] Multithreading enabled for route_design using a maximum of 8 CPUs
|
|
||||||
|
|
||||||
Phase 1 Build RT Design
|
|
||||||
Checksum: PlaceDB: 76da8209 ConstDB: 0 ShapeSum: 6615a195 RouteDB: 0
|
|
||||||
Post Restoration Checksum: NetGraph: 4a144a14 | NumContArr: af14b29e | Constraints: c2a8fa9d | Timing: c2a8fa9d
|
|
||||||
Phase 1 Build RT Design | Checksum: 27e7af1ec
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:49 ; elapsed = 00:00:32 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 5905 ; free virtual = 66985
|
|
||||||
|
|
||||||
Phase 2 Router Initialization
|
|
||||||
|
|
||||||
Phase 2.1 Fix Topology Constraints
|
|
||||||
Phase 2.1 Fix Topology Constraints | Checksum: 27e7af1ec
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:50 ; elapsed = 00:00:32 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 5899 ; free virtual = 66984
|
|
||||||
|
|
||||||
Phase 2.2 Pre Route Cleanup
|
|
||||||
Phase 2.2 Pre Route Cleanup | Checksum: 27e7af1ec
|
|
||||||
|
|
||||||
Time (s): cpu = 00:00:50 ; elapsed = 00:00:32 . Memory (MB): peak = 3998.043 ; gain = 0.000 ; free physical = 5899 ; free virtual = 66984
|
|
||||||
Number of Nodes with overlaps = 0
|
|
||||||
|
|
||||||
Phase 2.3 Update Timing
|
|
||||||
Phase 2.3 Update Timing | Checksum: 32928bcd2
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:06 ; elapsed = 00:00:40 . Memory (MB): peak = 4046.500 ; gain = 48.457 ; free physical = 5635 ; free virtual = 66801
|
|
||||||
INFO: [Route 35-416] Intermediate Timing Summary | WNS=2.632 | TNS=0.000 | WHS=-0.263 | THS=-1616.164|
|
|
||||||
|
|
||||||
|
|
||||||
Phase 2.4 Update Timing for Bus Skew
|
|
||||||
|
|
||||||
Phase 2.4.1 Update Timing
|
|
||||||
Phase 2.4.1 Update Timing | Checksum: 2864114c5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:19 ; elapsed = 00:00:43 . Memory (MB): peak = 4046.500 ; gain = 48.457 ; free physical = 5449 ; free virtual = 66672
|
|
||||||
INFO: [Route 35-416] Intermediate Timing Summary | WNS=2.632 | TNS=0.000 | WHS=N/A | THS=N/A |
|
|
||||||
|
|
||||||
Phase 2.4 Update Timing for Bus Skew | Checksum: 291576a87
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:19 ; elapsed = 00:00:44 . Memory (MB): peak = 4046.500 ; gain = 48.457 ; free physical = 5447 ; free virtual = 66671
|
|
||||||
|
|
||||||
Router Utilization Summary
|
|
||||||
Global Vertical Routing Utilization = 0.0211705 %
|
|
||||||
Global Horizontal Routing Utilization = 0.00488761 %
|
|
||||||
Routable Net Status*
|
|
||||||
*Does not include unroutable nets such as driverless and loadless.
|
|
||||||
Run report_route_status for detailed report.
|
|
||||||
Number of Failed Nets = 38492
|
|
||||||
(Failed Nets is the sum of unrouted and partially routed nets)
|
|
||||||
Number of Unrouted Nets = 38484
|
|
||||||
Number of Partially Routed Nets = 8
|
|
||||||
Number of Node Overlaps = 6
|
|
||||||
|
|
||||||
Phase 2 Router Initialization | Checksum: 2a426d310
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:20 ; elapsed = 00:00:44 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5405 ; free virtual = 66633
|
|
||||||
|
|
||||||
Phase 3 Initial Routing
|
|
||||||
|
|
||||||
Phase 3.1 Global Routing
|
|
||||||
Phase 3.1 Global Routing | Checksum: 2a426d310
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:20 ; elapsed = 00:00:44 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5405 ; free virtual = 66633
|
|
||||||
|
|
||||||
Phase 3.2 Initial Net Routing
|
|
||||||
Phase 3.2 Initial Net Routing | Checksum: 22defbe6f
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:27 ; elapsed = 00:00:46 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5394 ; free virtual = 66641
|
|
||||||
Phase 3 Initial Routing | Checksum: 22defbe6f
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:27 ; elapsed = 00:00:46 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5394 ; free virtual = 66641
|
|
||||||
|
|
||||||
Phase 4 Rip-up And Reroute
|
|
||||||
|
|
||||||
Phase 4.1 Global Iteration 0
|
|
||||||
Number of Nodes with overlaps = 2836
|
|
||||||
Number of Nodes with overlaps = 86
|
|
||||||
Number of Nodes with overlaps = 3
|
|
||||||
Number of Nodes with overlaps = 0
|
|
||||||
INFO: [Route 35-416] Intermediate Timing Summary | WNS=1.177 | TNS=0.000 | WHS=N/A | THS=N/A |
|
|
||||||
|
|
||||||
Phase 4.1 Global Iteration 0 | Checksum: 23a222cd5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:43 ; elapsed = 00:00:54 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5385 ; free virtual = 66739
|
|
||||||
Phase 4 Rip-up And Reroute | Checksum: 23a222cd5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:43 ; elapsed = 00:00:54 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5385 ; free virtual = 66739
|
|
||||||
|
|
||||||
Phase 5 Delay and Skew Optimization
|
|
||||||
|
|
||||||
Phase 5.1 Delay CleanUp
|
|
||||||
Phase 5.1 Delay CleanUp | Checksum: 23a222cd5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:43 ; elapsed = 00:00:54 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5384 ; free virtual = 66738
|
|
||||||
|
|
||||||
Phase 5.2 Clock Skew Optimization
|
|
||||||
Phase 5.2 Clock Skew Optimization | Checksum: 23a222cd5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:43 ; elapsed = 00:00:54 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5384 ; free virtual = 66738
|
|
||||||
Phase 5 Delay and Skew Optimization | Checksum: 23a222cd5
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:43 ; elapsed = 00:00:54 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5384 ; free virtual = 66738
|
|
||||||
|
|
||||||
Phase 6 Post Hold Fix
|
|
||||||
|
|
||||||
Phase 6.1 Hold Fix Iter
|
|
||||||
|
|
||||||
Phase 6.1.1 Update Timing
|
|
||||||
Phase 6.1.1 Update Timing | Checksum: 2a8514d39
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:47 ; elapsed = 00:00:56 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5382 ; free virtual = 66749
|
|
||||||
INFO: [Route 35-416] Intermediate Timing Summary | WNS=1.189 | TNS=0.000 | WHS=0.028 | THS=0.000 |
|
|
||||||
|
|
||||||
Phase 6.1 Hold Fix Iter | Checksum: 253fa4620
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:47 ; elapsed = 00:00:56 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5381 ; free virtual = 66748
|
|
||||||
Phase 6 Post Hold Fix | Checksum: 253fa4620
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:47 ; elapsed = 00:00:56 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5381 ; free virtual = 66748
|
|
||||||
|
|
||||||
Phase 7 Route finalize
|
|
||||||
|
|
||||||
Router Utilization Summary
|
|
||||||
Global Vertical Routing Utilization = 2.42898 %
|
|
||||||
Global Horizontal Routing Utilization = 2.87613 %
|
|
||||||
Routable Net Status*
|
|
||||||
*Does not include unroutable nets such as driverless and loadless.
|
|
||||||
Run report_route_status for detailed report.
|
|
||||||
Number of Failed Nets = 0
|
|
||||||
(Failed Nets is the sum of unrouted and partially routed nets)
|
|
||||||
Number of Unrouted Nets = 0
|
|
||||||
Number of Partially Routed Nets = 0
|
|
||||||
Number of Node Overlaps = 0
|
|
||||||
|
|
||||||
Phase 7 Route finalize | Checksum: 253fa4620
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:48 ; elapsed = 00:00:56 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5381 ; free virtual = 66748
|
|
||||||
|
|
||||||
Phase 8 Verifying routed nets
|
|
||||||
|
|
||||||
Verification completed successfully
|
|
||||||
Phase 8 Verifying routed nets | Checksum: 253fa4620
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:48 ; elapsed = 00:00:56 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5381 ; free virtual = 66748
|
|
||||||
|
|
||||||
Phase 9 Depositing Routes
|
|
||||||
Phase 9 Depositing Routes | Checksum: 24ae08112
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:50 ; elapsed = 00:00:57 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5378 ; free virtual = 66754
|
|
||||||
|
|
||||||
Phase 10 Post Router Timing
|
|
||||||
INFO: [Route 35-57] Estimated Timing Summary | WNS=1.189 | TNS=0.000 | WHS=0.028 | THS=0.000 |
|
|
||||||
|
|
||||||
INFO: [Route 35-327] The final timing numbers are based on the router estimated timing analysis. For a complete and accurate timing signoff, please run report_timing_summary.
|
|
||||||
Phase 10 Post Router Timing | Checksum: 24ae08112
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:53 ; elapsed = 00:00:58 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5367 ; free virtual = 66762
|
|
||||||
INFO: [Route 35-16] Router Completed Successfully
|
|
||||||
|
|
||||||
Phase 11 Post-Route Event Processing
|
|
||||||
Phase 11 Post-Route Event Processing | Checksum: 10a817867
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:54 ; elapsed = 00:00:59 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5358 ; free virtual = 66761
|
|
||||||
Ending Routing Task | Checksum: 10a817867
|
|
||||||
|
|
||||||
Time (s): cpu = 00:01:55 ; elapsed = 00:01:00 . Memory (MB): peak = 4082.977 ; gain = 84.934 ; free physical = 5334 ; free virtual = 66752
|
|
||||||
|
|
||||||
Routing Is Done.
|
|
||||||
INFO: [Common 17-83] Releasing license: Implementation
|
|
||||||
108 Infos, 82 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
route_design completed successfully
|
|
||||||
route_design: Time (s): cpu = 00:01:59 ; elapsed = 00:01:02 . Memory (MB): peak = 4083.043 ; gain = 85.000 ; free physical = 5335 ; free virtual = 66757
|
|
||||||
INFO: [runtcl-4] Executing : report_drc -file system_wrapper_drc_routed.rpt -pb system_wrapper_drc_routed.pb -rpx system_wrapper_drc_routed.rpx
|
|
||||||
Command: report_drc -file system_wrapper_drc_routed.rpt -pb system_wrapper_drc_routed.pb -rpx system_wrapper_drc_routed.rpx
|
|
||||||
INFO: [IP_Flow 19-1839] IP Catalog is up to date.
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 2-168] The results of DRC are in file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_drc_routed.rpt.
|
|
||||||
report_drc completed successfully
|
|
||||||
INFO: [runtcl-4] Executing : report_methodology -file system_wrapper_methodology_drc_routed.rpt -pb system_wrapper_methodology_drc_routed.pb -rpx system_wrapper_methodology_drc_routed.rpx
|
|
||||||
Command: report_methodology -file system_wrapper_methodology_drc_routed.rpt -pb system_wrapper_methodology_drc_routed.pb -rpx system_wrapper_methodology_drc_routed.rpx
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
INFO: [DRC 23-133] Running Methodology with 8 threads
|
|
||||||
INFO: [Vivado_Tcl 2-1520] The results of Report Methodology are in file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_methodology_drc_routed.rpt.
|
|
||||||
report_methodology completed successfully
|
|
||||||
report_methodology: Time (s): cpu = 00:00:18 ; elapsed = 00:00:06 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 5233 ; free virtual = 66738
|
|
||||||
INFO: [runtcl-4] Executing : report_power -file system_wrapper_power_routed.rpt -pb system_wrapper_power_summary_routed.pb -rpx system_wrapper_power_routed.rpx
|
|
||||||
Command: report_power -file system_wrapper_power_routed.rpt -pb system_wrapper_power_summary_routed.pb -rpx system_wrapper_power_routed.rpx
|
|
||||||
INFO: [Power 33-23] Power model is not available for DNA_PORT_inst
|
|
||||||
INFO: [Timing 38-35] Done setting XDC timing constraints.
|
|
||||||
Running Vector-less Activity Propagation...
|
|
||||||
|
|
||||||
Finished Running Vector-less Activity Propagation
|
|
||||||
WARNING: [Power 33-332] Found switching activity that implies high-fanout reset nets being asserted for excessive periods of time which may result in inaccurate power analysis.
|
|
||||||
Resolution: To review and fix problems, please run Power Constraints Advisor in the GUI from Tools > Power Constraints Advisor or run report_power with the -advisory option to generate a text report.
|
|
||||||
119 Infos, 83 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
report_power completed successfully
|
|
||||||
report_power: Time (s): cpu = 00:00:16 ; elapsed = 00:00:06 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 5140 ; free virtual = 66731
|
|
||||||
INFO: [runtcl-4] Executing : report_route_status -file system_wrapper_route_status.rpt -pb system_wrapper_route_status.pb
|
|
||||||
INFO: [runtcl-4] Executing : report_timing_summary -max_paths 10 -file system_wrapper_timing_summary_routed.rpt -pb system_wrapper_timing_summary_routed.pb -rpx system_wrapper_timing_summary_routed.rpx -warn_on_violation
|
|
||||||
INFO: [Timing 38-91] UpdateTimingParams: Speed grade: -2, Delay Type: min_max.
|
|
||||||
INFO: [Timing 38-191] Multithreading enabled for timing update using a maximum of 8 CPUs
|
|
||||||
WARNING: [Timing 38-436] There are set_bus_skew constraint(s) in this design. Please run report_bus_skew to ensure that bus skew requirements are met.
|
|
||||||
INFO: [runtcl-4] Executing : report_incremental_reuse -file system_wrapper_incremental_reuse_routed.rpt
|
|
||||||
INFO: [Vivado_Tcl 4-1062] Incremental flow is disabled. No incremental reuse Info to report.
|
|
||||||
INFO: [runtcl-4] Executing : report_clock_utilization -file system_wrapper_clock_utilization_routed.rpt
|
|
||||||
INFO: [runtcl-4] Executing : report_bus_skew -warn_on_violation -file system_wrapper_bus_skew_routed.rpt -pb system_wrapper_bus_skew_routed.pb -rpx system_wrapper_bus_skew_routed.rpx
|
|
||||||
INFO: [Timing 38-91] UpdateTimingParams: Speed grade: -2, Delay Type: min_max.
|
|
||||||
INFO: [Timing 38-191] Multithreading enabled for timing update using a maximum of 8 CPUs
|
|
||||||
INFO: [Timing 38-480] Writing timing data to binary archive.
|
|
||||||
Write ShapeDB Complete: Time (s): cpu = 00:00:00.4 ; elapsed = 00:00:00.08 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 5090 ; free virtual = 66740
|
|
||||||
Wrote PlaceDB: Time (s): cpu = 00:00:04 ; elapsed = 00:00:01 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 5008 ; free virtual = 66718
|
|
||||||
Wrote PulsedLatchDB: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 5008 ; free virtual = 66718
|
|
||||||
Writing XDEF routing.
|
|
||||||
Writing XDEF routing logical nets.
|
|
||||||
Writing XDEF routing special nets.
|
|
||||||
Wrote RouteStorage: Time (s): cpu = 00:00:00.79 ; elapsed = 00:00:00.29 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 4994 ; free virtual = 66717
|
|
||||||
Wrote Netlist Cache: Time (s): cpu = 00:00:00.08 ; elapsed = 00:00:00.05 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 4994 ; free virtual = 66719
|
|
||||||
Wrote Device Cache: Time (s): cpu = 00:00:00.01 ; elapsed = 00:00:00.01 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 4994 ; free virtual = 66720
|
|
||||||
Write Physdb Complete: Time (s): cpu = 00:00:05 ; elapsed = 00:00:02 . Memory (MB): peak = 4299.051 ; gain = 0.000 ; free physical = 4994 ; free virtual = 66721
|
|
||||||
INFO: [Common 17-1381] The checkpoint '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/impl_1/system_wrapper_routed.dcp' has been generated.
|
|
||||||
Command: write_bitstream -force system_wrapper.bit
|
|
||||||
Attempting to get a license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-349] Got license for feature 'Implementation' and/or device 'xc7z035'
|
|
||||||
Running DRC as a precondition to command write_bitstream
|
|
||||||
INFO: [IP_Flow 19-1839] IP Catalog is up to date.
|
|
||||||
INFO: [DRC 23-27] Running DRC with 8 threads
|
|
||||||
WARNING: [DRC PDCN-1569] LUT equation term check: Used physical LUT pin 'A3' of cell dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/temp_curid[31]_i_1 (pin dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/temp_curid[31]_i_1/I0) is not included in the LUT equation: 'O5=(A1*A2)+(A1*(~A2)*(~A4))+((~A1))'. If this cell is a user instantiated LUT in the design, please remove connectivity to the pin or change the equation and/or INIT string of the LUT to prevent this issue. If the cell is inferred or IP created LUT, please regenerate the IP and/or resynthesize the design to attempt to correct the issue.
|
|
||||||
WARNING: [DRC PDCN-1569] LUT equation term check: Used physical LUT pin 'A3' of cell dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.id_state[0]_i_1 (pin dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.id_state[0]_i_1/I0) is not included in the LUT equation: 'O6=(A6+~A6)*((A5))'. If this cell is a user instantiated LUT in the design, please remove connectivity to the pin or change the equation and/or INIT string of the LUT to prevent this issue. If the cell is inferred or IP created LUT, please regenerate the IP and/or resynthesize the design to attempt to correct the issue.
|
|
||||||
WARNING: [DRC PDCN-1569] LUT equation term check: Used physical LUT pin 'A5' of cell dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/temp_curid[31]_i_1 (pin dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/temp_curid[31]_i_1/I1) is not included in the LUT equation: 'O5=(A1*A2)+(A1*(~A2)*(~A4))+((~A1))'. If this cell is a user instantiated LUT in the design, please remove connectivity to the pin or change the equation and/or INIT string of the LUT to prevent this issue. If the cell is inferred or IP created LUT, please regenerate the IP and/or resynthesize the design to attempt to correct the issue.
|
|
||||||
WARNING: [DRC RTSTAT-10] No routable loads: 21 net(s) have no routable loads. The problem bus(es) and/or net(s) are dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_inst/TMS, dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_RD/U_RD_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_rdfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/gntv_or_sync_fifo.gl0.rd/gr1.gr1_int.rfwft/aempty_fwft_i, dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD7_CTL/ctl_reg[2:0], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD1/ctl_reg_en_2[1], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD7_CTL/ctl_reg_en_2[1], dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/m_bscan_capture[0], dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/m_bscan_drck[0], dbg_hub/inst/BSCANID.u_xsdbm_id/SWITCH_N_EXT_BSCAN.bscan_switch/m_bscan_runtest[0], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_WR/U_WR_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_wrfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/rstblk/ngwrdrst.grst.rd_rst_reg[0], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_RD/U_RD_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_rdfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/rstblk/ngwrdrst.grst.wr_rst_reg[2], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_WR/U_WR_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_wrfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/rstblk/ngwrdrst.grst.wr_rst_reg[2], dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_RD/U_RD_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_rdfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/gntv_or_sync_fifo.gl0.wr/gwhf.whf/overflow, dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_WR/U_WR_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_wrfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/gntv_or_sync_fifo.gl0.wr/gwhf.whf/overflow, dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_RD/U_RD_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_rdfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/gntv_or_sync_fifo.gl0.rd/gras.rsts/ram_empty_i, dbg_hub/inst/BSCANID.u_xsdbm_id/CORE_XSDB.UUT_MASTER/U_ICON_INTERFACE/U_CMD6_WR/U_WR_FIFO/SUBCORE_FIFO.xsdbm_v3_0_0_wrfifo_inst/inst_fifo_gen/gconvfifo.rf/grf.rf/gntv_or_sync_fifo.gl0.wr/gwas.wsts/ram_full_i... and (the first 15 of 19 listed).
|
|
||||||
INFO: [Vivado 12-3199] DRC finished with 0 Errors, 4 Warnings
|
|
||||||
INFO: [Vivado 12-3200] Please refer to the DRC report (report_drc) for more information.
|
|
||||||
INFO: [Designutils 20-2272] Running write_bitstream with 8 threads.
|
|
||||||
Loading data files...
|
|
||||||
Loading site data...
|
|
||||||
Loading route data...
|
|
||||||
Processing options...
|
|
||||||
Creating bitmap...
|
|
||||||
Creating bitstream...
|
|
||||||
Writing bitstream ./system_wrapper.bit...
|
|
||||||
INFO: [Vivado 12-1842] Bitgen Completed Successfully.
|
|
||||||
INFO: [Common 17-83] Releasing license: Implementation
|
|
||||||
13 Infos, 4 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
write_bitstream completed successfully
|
|
||||||
write_bitstream: Time (s): cpu = 00:00:27 ; elapsed = 00:00:21 . Memory (MB): peak = 4599.906 ; gain = 300.855 ; free physical = 4256 ; free virtual = 66217
|
|
||||||
INFO: [Common 17-206] Exiting Vivado at Wed May 27 16:43:10 2026...
|
|
||||||
@@ -1,696 +0,0 @@
|
|||||||
|
|
||||||
*** Running vivado
|
|
||||||
with args -log system_wrapper.vds -m64 -product Vivado -mode batch -messageDb vivado.pb -notrace -source system_wrapper.tcl
|
|
||||||
|
|
||||||
|
|
||||||
****** Vivado v2023.2 (64-bit)
|
|
||||||
**** SW Build 4029153 on Fri Oct 13 20:13:54 MDT 2023
|
|
||||||
**** IP Build 4028589 on Sat Oct 14 00:45:43 MDT 2023
|
|
||||||
**** SharedData Build 4025554 on Tue Oct 10 17:18:54 MDT 2023
|
|
||||||
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
|
|
||||||
** Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
|
||||||
|
|
||||||
source system_wrapper.tcl -notrace
|
|
||||||
INFO: [IP_Flow 19-234] Refreshing IP repositories
|
|
||||||
INFO: [IP_Flow 19-1704] No user IP repositories specified
|
|
||||||
INFO: [IP_Flow 19-2313] Loaded Vivado IP repository '/data/xilinx/Vivado/2023.2/data/ip'.
|
|
||||||
Command: synth_design -top system_wrapper -part xc7z035ffg676-2
|
|
||||||
Starting synth_design
|
|
||||||
Attempting to get a license for feature 'Synthesis' and/or device 'xc7z035'
|
|
||||||
INFO: [Common 17-349] Got license for feature 'Synthesis' and/or device 'xc7z035'
|
|
||||||
INFO: [Device 21-403] Loading part xc7z035ffg676-2
|
|
||||||
INFO: [Synth 8-7079] Multithreading enabled for synth_design using a maximum of 4 processes.
|
|
||||||
INFO: [Synth 8-7078] Launching helper process for spawning children vivado processes
|
|
||||||
INFO: [Synth 8-7075] Helper process launched with PID 958941
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Starting RTL Elaboration : Time (s): cpu = 00:00:03 ; elapsed = 00:00:03 . Memory (MB): peak = 2149.453 ; gain = 411.629 ; free physical = 845 ; free virtual = 70077
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
WARNING: [Synth 8-11121] redeclaration of ANSI port 'read_vld' is not allowed [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/dna_port_read.v:33]
|
|
||||||
WARNING: [Synth 8-11121] redeclaration of ANSI port 'dna_port' is not allowed [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/dna_port_read.v:34]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_wrapper' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:13]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'IOBUF' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:78197]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'IOBUF' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:78197]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:318]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_dna_port_read_0_0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_dna_port_read_0_0/synth/system_dna_port_read_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'dna_port_read' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/dna_port_read.v:23]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'DNA_PORT' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:39264]
|
|
||||||
Parameter SIM_DNA_VALUE bound to: 57'b000000000000000000000000000000000000000000000000000000000
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'DNA_PORT' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:39264]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'dna_port_read' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/dna_port_read.v:23]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_dna_port_read_0_0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_dna_port_read_0_0/synth/system_dna_port_read_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_mydna_read_v1_0_0_0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_mydna_read_v1_0_0_0/synth/system_mydna_read_v1_0_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'mydna_read_v1_0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0.v:4]
|
|
||||||
Parameter C_S00_AXI_DATA_WIDTH bound to: 32 - type: integer
|
|
||||||
Parameter C_S00_AXI_ADDR_WIDTH bound to: 4 - type: integer
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'mydna_read_v1_0_S00_AXI' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:4]
|
|
||||||
Parameter C_S_AXI_DATA_WIDTH bound to: 32 - type: integer
|
|
||||||
Parameter C_S_AXI_ADDR_WIDTH bound to: 4 - type: integer
|
|
||||||
INFO: [Synth 8-226] default block is never used [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:235]
|
|
||||||
INFO: [Synth 8-226] default block is never used [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:379]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'mydna_read_v1_0_S00_AXI' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:4]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'mydna_read_v1_0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0.v:4]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_mydna_read_v1_0_0_0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_mydna_read_v1_0_0_0/synth/system_mydna_read_v1_0_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_processing_system7_0_0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'processing_system7_v5_5_processing_system7' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/hdl/verilog/processing_system7_v5_5_processing_system7.v:152]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'BUFG' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:1951]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'BUFG' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:1951]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'BIBUF' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:1598]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'BIBUF' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:1598]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'PS7' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:111859]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'PS7' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:111859]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'processing_system7_v5_5_processing_system7' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/hdl/verilog/processing_system7_v5_5_processing_system7.v:152]
|
|
||||||
WARNING: [Synth 8-7071] port 'M_AXI_GP0_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'M_AXI_GP1_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_GP0_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_GP1_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_ACP_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_HP0_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_HP1_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_HP2_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'S_AXI_HP3_ARESETN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'DMA0_RSTN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'DMA1_RSTN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'DMA2_RSTN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7071] port 'DMA3_RSTN' of module 'processing_system7_v5_5_processing_system7' is unconnected for instance 'inst' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
WARNING: [Synth 8-7023] instance 'inst' of module 'processing_system7_v5_5_processing_system7' has 685 connections declared, but only 672 given [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:323]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_processing_system7_0_0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/synth/system_processing_system7_0_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_ps7_0_axi_periph_1' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:632]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 's00_couplers_imp_11SE3QO' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:13]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'system_auto_pc_0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_auto_pc_0/synth/system_auto_pc_0.v:53]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_axi_protocol_converter' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:5285]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4704]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_aw_channel' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4360]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_cmd_translator' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3720]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_incr_cmd' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3216]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_incr_cmd' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3216]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_wrap_cmd' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2982]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_wrap_cmd' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2982]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_cmd_translator' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3720]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_wr_cmd_fsm' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3392]
|
|
||||||
INFO: [Synth 8-226] default block is never used [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3446]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_wr_cmd_fsm' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3392]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_aw_channel' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4360]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_b_channel' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3906]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_b_channel' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3906]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_ar_channel' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4516]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3546]
|
|
||||||
INFO: [Synth 8-226] default block is never used [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3608]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3546]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_ar_channel' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4516]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_r_channel' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4155]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized1' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized1' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized2' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_simple_fifo__parameterized2' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:2852]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s_r_channel' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4155]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axi_register_slice' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:3718]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_infrastructure_v1_1_0_axi2vector' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:59]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_infrastructure_v1_1_0_axi2vector' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:59]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_infrastructure_v1_1_0_vector2axi' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:473]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_infrastructure_v1_1_0_vector2axi' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:473]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized1' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized1' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized2' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized2' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axi_register_slice' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:3718]
|
|
||||||
WARNING: [Synth 8-7071] port 'aclk2x' of module 'axi_register_slice_v2_1_29_axi_register_slice' is unconnected for instance 'SI_REG' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4871]
|
|
||||||
WARNING: [Synth 8-7023] instance 'SI_REG' of module 'axi_register_slice_v2_1_29_axi_register_slice' has 93 connections declared, but only 92 given [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4871]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axi_register_slice__parameterized0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:3718]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_infrastructure_v1_1_0_axi2vector__parameterized0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:59]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_infrastructure_v1_1_0_axi2vector__parameterized0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:59]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_infrastructure_v1_1_0_vector2axi__parameterized0' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:473]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_infrastructure_v1_1_0_vector2axi__parameterized0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v:473]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized3' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized3' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized4' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized4' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized5' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized5' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized6' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axic_register_slice__parameterized6' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1492]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_register_slice_v2_1_29_axi_register_slice__parameterized0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:3718]
|
|
||||||
WARNING: [Synth 8-7071] port 'aclk2x' of module 'axi_register_slice_v2_1_29_axi_register_slice' is unconnected for instance 'MI_REG' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:5126]
|
|
||||||
WARNING: [Synth 8-7023] instance 'MI_REG' of module 'axi_register_slice_v2_1_29_axi_register_slice' has 93 connections declared, but only 92 given [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:5126]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_b2s' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:4704]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'axi_protocol_converter_v2_1_29_axi_protocol_converter' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:5285]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_auto_pc_0' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_auto_pc_0/synth/system_auto_pc_0.v:53]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 's00_couplers_imp_11SE3QO' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:13]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_ps7_0_axi_periph_1' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:632]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'system_rst_ps7_0_100M_1' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/synth/system_rst_ps7_0_100M_1.vhd:74]
|
|
||||||
Parameter C_FAMILY bound to: zynq - type: string
|
|
||||||
Parameter C_EXT_RST_WIDTH bound to: 4 - type: integer
|
|
||||||
Parameter C_AUX_RST_WIDTH bound to: 4 - type: integer
|
|
||||||
Parameter C_EXT_RESET_HIGH bound to: 1'b0
|
|
||||||
Parameter C_AUX_RESET_HIGH bound to: 1'b0
|
|
||||||
Parameter C_NUM_BUS_RST bound to: 1 - type: integer
|
|
||||||
Parameter C_NUM_PERP_RST bound to: 1 - type: integer
|
|
||||||
Parameter C_NUM_INTERCONNECT_ARESETN bound to: 1 - type: integer
|
|
||||||
Parameter C_NUM_PERP_ARESETN bound to: 1 - type: integer
|
|
||||||
INFO: [Synth 8-3491] module 'proc_sys_reset' declared at '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1271' bound to instance 'U0' of component 'proc_sys_reset' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/synth/system_rst_ps7_0_100M_1.vhd:129]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'proc_sys_reset' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1330]
|
|
||||||
Parameter INIT bound to: 1'b1
|
|
||||||
INFO: [Synth 8-113] binding component instance 'FDRE_inst' to cell 'FDRE' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1399]
|
|
||||||
Parameter INIT bound to: 1'b1
|
|
||||||
INFO: [Synth 8-113] binding component instance 'FDRE_BSR' to cell 'FDRE' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1415]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'FDRE_BSR_N' to cell 'FDRE' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1441]
|
|
||||||
Parameter INIT bound to: 1'b1
|
|
||||||
INFO: [Synth 8-113] binding component instance 'FDRE_PER' to cell 'FDRE' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1464]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'FDRE_PER_N' to cell 'FDRE' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1488]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'lpf' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:821]
|
|
||||||
INFO: [Synth 8-3491] module 'SRL16' declared at '/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:133721' bound to instance 'POR_SRL_I' of component 'SRL16' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:873]
|
|
||||||
INFO: [Synth 8-6157] synthesizing module 'SRL16' [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:133721]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'SRL16' (0#1) [/data/xilinx/Vivado/2023.2/scripts/rt/data/unisim_comp.v:133721]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'cdc_sync' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:106]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_IN_cdc_to' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:514]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_s_level_out_d2' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:545]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_s_level_out_d3' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:554]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_s_level_out_d4' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:564]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_s_level_out_d5' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:574]
|
|
||||||
Parameter INIT bound to: 1'b0
|
|
||||||
INFO: [Synth 8-113] binding component instance 'CROSS_PLEVEL_IN2SCNDRY_s_level_out_d6' to cell 'FDR' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:584]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'cdc_sync' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd:106]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'lpf' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:821]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'sequence_psr' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:304]
|
|
||||||
INFO: [Synth 8-638] synthesizing module 'upcnt_n' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:126]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'upcnt_n' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:126]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'sequence_psr' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:304]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'proc_sys_reset' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/408c/hdl/proc_sys_reset_v5_0_vh_rfs.vhd:1330]
|
|
||||||
INFO: [Synth 8-256] done synthesizing module 'system_rst_ps7_0_100M_1' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/synth/system_rst_ps7_0_100M_1.vhd:74]
|
|
||||||
WARNING: [Synth 8-7071] port 'mb_reset' of module 'system_rst_ps7_0_100M_1' is unconnected for instance 'rst_ps7_0_100M' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:622]
|
|
||||||
WARNING: [Synth 8-7071] port 'bus_struct_reset' of module 'system_rst_ps7_0_100M_1' is unconnected for instance 'rst_ps7_0_100M' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:622]
|
|
||||||
WARNING: [Synth 8-7071] port 'peripheral_reset' of module 'system_rst_ps7_0_100M_1' is unconnected for instance 'rst_ps7_0_100M' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:622]
|
|
||||||
WARNING: [Synth 8-7023] instance 'rst_ps7_0_100M' of module 'system_rst_ps7_0_100M_1' has 10 connections declared, but only 7 given [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:622]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/synth/system.v:318]
|
|
||||||
INFO: [Synth 8-6155] done synthesizing module 'system_wrapper' (0#1) [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:13]
|
|
||||||
WARNING: [Synth 8-6014] Unused sequential element slv_reg1_reg was removed. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:228]
|
|
||||||
WARNING: [Synth 8-6014] Unused sequential element slv_reg2_reg was removed. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:229]
|
|
||||||
WARNING: [Synth 8-6014] Unused sequential element state_r1_reg was removed. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3596]
|
|
||||||
WARNING: [Synth 8-6014] Unused sequential element s_arlen_r_reg was removed. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/a63f/hdl/axi_protocol_converter_v2_1_vl_rfs.v:3597]
|
|
||||||
WARNING: [Synth 8-7129] Port prmry_aclk in module cdc_sync is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port prmry_resetn in module cdc_sync is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port prmry_vect_in[1] in module cdc_sync is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port prmry_vect_in[0] in module cdc_sync is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port scndry_resetn in module cdc_sync is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ACLK in module axi_register_slice_v2_1_29_axic_register_slice__parameterized6 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ARESET in module axi_register_slice_v2_1_29_axic_register_slice__parameterized6 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ACLK in module axi_register_slice_v2_1_29_axic_register_slice__parameterized3 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ARESET in module axi_register_slice_v2_1_29_axic_register_slice__parameterized3 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ACLK in module axi_register_slice_v2_1_29_axic_register_slice__parameterized5 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ARESET in module axi_register_slice_v2_1_29_axic_register_slice__parameterized5 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ACLK in module axi_register_slice_v2_1_29_axic_register_slice__parameterized4 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ARESET in module axi_register_slice_v2_1_29_axic_register_slice__parameterized4 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_bid[0] in module axi_infrastructure_v1_1_0_vector2axi__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_buser[0] in module axi_infrastructure_v1_1_0_vector2axi__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_rid[0] in module axi_infrastructure_v1_1_0_vector2axi__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_rlast in module axi_infrastructure_v1_1_0_vector2axi__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_ruser[0] in module axi_infrastructure_v1_1_0_vector2axi__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awid[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[7] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[6] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[5] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[4] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlen[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awsize[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awsize[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awsize[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awburst[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awburst[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awlock[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awcache[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awcache[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awcache[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awcache[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awqos[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awqos[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awqos[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awqos[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awuser[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_wid[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_wlast in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_wuser[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arid[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[7] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[6] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[5] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[4] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlen[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arsize[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arsize[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arsize[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arburst[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arburst[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arlock[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arcache[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arcache[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arcache[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arcache[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arqos[3] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arqos[2] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arqos[1] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arqos[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_aruser[0] in module axi_infrastructure_v1_1_0_axi2vector__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port aclk2x in module axi_register_slice_v2_1_29_axi_register_slice__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ACLK in module axi_register_slice_v2_1_29_axic_register_slice__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port ARESET in module axi_register_slice_v2_1_29_axic_register_slice__parameterized0 is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_buser[0] in module axi_infrastructure_v1_1_0_vector2axi is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port m_axi_ruser[0] in module axi_infrastructure_v1_1_0_vector2axi is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[3] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[2] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[1] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awregion[0] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_awuser[0] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_wuser[0] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[3] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[2] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[1] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_arregion[0] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_axi_aruser[0] in module axi_infrastructure_v1_1_0_axi2vector is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port aclk2x in module axi_register_slice_v2_1_29_axi_register_slice is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[7] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[6] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[5] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[4] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[3] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
WARNING: [Synth 8-7129] Port s_arlen[2] in module axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm is either unconnected or has no load
|
|
||||||
INFO: [Common 17-14] Message 'Synth 8-7129' appears 100 times and further instances of the messages will be disabled. Use the Tcl command set_msg_config to change the current settings.
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished RTL Elaboration : Time (s): cpu = 00:00:05 ; elapsed = 00:00:06 . Memory (MB): peak = 2356.422 ; gain = 618.598 ; free physical = 767 ; free virtual = 69885
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Handling Custom Attributes
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Handling Custom Attributes : Time (s): cpu = 00:00:05 ; elapsed = 00:00:06 . Memory (MB): peak = 2356.422 ; gain = 618.598 ; free physical = 768 ; free virtual = 69891
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished RTL Optimization Phase 1 : Time (s): cpu = 00:00:05 ; elapsed = 00:00:06 . Memory (MB): peak = 2356.422 ; gain = 618.598 ; free physical = 768 ; free virtual = 69891
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.03 ; elapsed = 00:00:00.03 . Memory (MB): peak = 2359.391 ; gain = 0.000 ; free physical = 749 ; free virtual = 69874
|
|
||||||
INFO: [Netlist 29-17] Analyzing 46 Unisim elements for replacement
|
|
||||||
INFO: [Netlist 29-28] Unisim Transformation completed in 0 CPU seconds
|
|
||||||
INFO: [Project 1-570] Preparing netlist for logic optimization
|
|
||||||
|
|
||||||
Processing XDC Constraints
|
|
||||||
Initializing timing engine
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/system_processing_system7_0_0.xdc] for cell 'system_i/processing_system7_0/inst'
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/system_processing_system7_0_0.xdc] for cell 'system_i/processing_system7_0/inst'
|
|
||||||
INFO: [Project 1-236] Implementation specific constraints were found while reading constraint file [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_processing_system7_0_0/system_processing_system7_0_0.xdc]. These constraints will be ignored for synthesis but will be used in implementation. Impacted constraints are listed in the file [.Xil/system_wrapper_propImpl.xdc].
|
|
||||||
Resolution: To avoid this warning, move constraints listed in [.Xil/system_wrapper_propImpl.xdc] to another XDC file and exclude this new file from synthesis with the used_in_synthesis property (File Properties dialog in GUI) and re-run elaboration/synthesis.
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1_board.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1_board.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc] for cell 'system_i/rst_ps7_0_100M/U0'
|
|
||||||
INFO: [Project 1-236] Implementation specific constraints were found while reading constraint file [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ip/system_rst_ps7_0_100M_1/system_rst_ps7_0_100M_1.xdc]. These constraints will be ignored for synthesis but will be used in implementation. Impacted constraints are listed in the file [.Xil/system_wrapper_propImpl.xdc].
|
|
||||||
Resolution: To avoid this warning, move constraints listed in [.Xil/system_wrapper_propImpl.xdc] to another XDC file and exclude this new file from synthesis with the used_in_synthesis property (File Properties dialog in GUI) and re-run elaboration/synthesis.
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_cons.xdc]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_cons.xdc]
|
|
||||||
INFO: [Project 1-236] Implementation specific constraints were found while reading constraint file [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_cons.xdc]. These constraints will be ignored for synthesis but will be used in implementation. Impacted constraints are listed in the file [.Xil/system_wrapper_propImpl.xdc].
|
|
||||||
Resolution: To avoid this warning, move constraints listed in [.Xil/system_wrapper_propImpl.xdc] to another XDC file and exclude this new file from synthesis with the used_in_synthesis property (File Properties dialog in GUI) and re-run elaboration/synthesis.
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc]
|
|
||||||
INFO: [Project 1-236] Implementation specific constraints were found while reading constraint file [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc]. These constraints will be ignored for synthesis but will be used in implementation. Impacted constraints are listed in the file [.Xil/system_wrapper_propImpl.xdc].
|
|
||||||
Resolution: To avoid this warning, move constraints listed in [.Xil/system_wrapper_propImpl.xdc] to another XDC file and exclude this new file from synthesis with the used_in_synthesis property (File Properties dialog in GUI) and re-run elaboration/synthesis.
|
|
||||||
Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/dont_touch.xdc]
|
|
||||||
Finished Parsing XDC File [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/dont_touch.xdc]
|
|
||||||
INFO: [Project 1-236] Implementation specific constraints were found while reading constraint file [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/dont_touch.xdc]. These constraints will be ignored for synthesis but will be used in implementation. Impacted constraints are listed in the file [.Xil/system_wrapper_propImpl.xdc].
|
|
||||||
Resolution: To avoid this warning, move constraints listed in [.Xil/system_wrapper_propImpl.xdc] to another XDC file and exclude this new file from synthesis with the used_in_synthesis property (File Properties dialog in GUI) and re-run elaboration/synthesis.
|
|
||||||
Completed Processing XDC Constraints
|
|
||||||
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 2518.867 ; gain = 0.000 ; free physical = 714 ; free virtual = 69858
|
|
||||||
INFO: [Project 1-111] Unisim Transformation Summary:
|
|
||||||
A total of 46 instances were transformed.
|
|
||||||
FDR => FDRE: 12 instances
|
|
||||||
IOBUF => IOBUF (IBUF, OBUFT): 33 instances
|
|
||||||
SRL16 => SRL16E: 1 instance
|
|
||||||
|
|
||||||
Constraint Validation Runtime : Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:00.02 . Memory (MB): peak = 2518.902 ; gain = 0.000 ; free physical = 872 ; free virtual = 69870
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Constraint Validation : Time (s): cpu = 00:00:10 ; elapsed = 00:00:10 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 946 ; free virtual = 69833
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Loading Part and Timing Information
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Loading part: xc7z035ffg676-2
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Loading Part and Timing Information : Time (s): cpu = 00:00:10 ; elapsed = 00:00:10 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 945 ; free virtual = 69833
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Applying 'set_property' XDC Constraints
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_0. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 1).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_1. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 2).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_2. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 3).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_3. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 4).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_4. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 5).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_5. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 6).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_6. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 7).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_7. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 8).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_8. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 9).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_9. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 10).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_10. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 11).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_11. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 12).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_12. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 13).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_13. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 14).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_14. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 15).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_15. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 16).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_16. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 17).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_17. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 18).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_18. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 19).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_19. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 20).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_20. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 21).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_21. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 22).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_22. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 23).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_23. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 24).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_24. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 25).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_25. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 26).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_28. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 27).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_29. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 28).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_30. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 29).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_26. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 30).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_27. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 31).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_31. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 32).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_i_32. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 33).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_o_0. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 34).
|
|
||||||
Applied set_property MARK_DEBUG = true for EMIO_0_tri_t_0. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/constrs_1/new/pin_debug.xdc, line 67).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/processing_system7_0/inst. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/dont_touch.xdc, line 30).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/rst_ps7_0_100M/U0. (constraint file /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/dont_touch.xdc, line 35).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/processing_system7_0. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/dna_port_read_0. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/mydna_read_v1_0_0. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/ps7_0_axi_periph/s00_couplers/auto_pc. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/ps7_0_axi_periph. (constraint file auto generated constraint).
|
|
||||||
Applied set_property KEEP_HIERARCHY = SOFT for system_i/rst_ps7_0_100M. (constraint file auto generated constraint).
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished applying 'set_property' XDC Constraints : Time (s): cpu = 00:00:10 ; elapsed = 00:00:10 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 940 ; free virtual = 69830
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
INFO: [Synth 8-802] inferred FSM for state register 'state_reg' in module 'axi_protocol_converter_v2_1_29_b2s_wr_cmd_fsm'
|
|
||||||
INFO: [Synth 8-802] inferred FSM for state register 'state_reg' in module 'axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm'
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_0'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:213]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_1'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:218]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_2'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:273]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_3'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:328]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_4'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:348]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_5'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:353]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_6'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:358]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_7'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:363]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_8'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:368]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_9'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:373]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_10'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:223]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_11'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:228]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_12'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:233]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_13'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:238]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_14'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:243]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_15'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:248]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_16'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:253]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_17'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:258]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_18'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:263]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_19'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:268]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_20'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:278]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_21'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:283]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_22'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:288]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_23'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:293]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_24'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:298]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_25'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:303]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_28'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:318]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_29'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:323]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_30'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:333]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_26'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:308]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_27'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:313]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_31'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:338]
|
|
||||||
INFO: [Synth 8-6071] Mark debug on the nets applies keep_hierarchy on instance 'EMIO_0_tri_iobuf_32'. This will prevent further optimization [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/hdl/system_wrapper.v:343]
|
|
||||||
WARNING: [Synth 8-327] inferring latch for variable 'dna_port_reg_reg' [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.srcs/sources_1/src/mydna_read_v1_0_S00_AXI.v:413]
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
State | New Encoding | Previous Encoding
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
SM_IDLE | 01 | 00
|
|
||||||
SM_CMD_EN | 11 | 01
|
|
||||||
SM_CMD_ACCEPTED | 10 | 10
|
|
||||||
SM_DONE_WAIT | 00 | 11
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
INFO: [Synth 8-3354] encoded FSM with state register 'state_reg' using encoding 'sequential' in module 'axi_protocol_converter_v2_1_29_b2s_wr_cmd_fsm'
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
State | New Encoding | Previous Encoding
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
SM_IDLE | 01 | 00
|
|
||||||
SM_CMD_EN | 11 | 01
|
|
||||||
SM_CMD_ACCEPTED | 10 | 10
|
|
||||||
SM_DONE | 00 | 11
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
INFO: [Synth 8-3354] encoded FSM with state register 'state_reg' using encoding 'sequential' in module 'axi_protocol_converter_v2_1_29_b2s_rd_cmd_fsm'
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished RTL Optimization Phase 2 : Time (s): cpu = 00:00:10 ; elapsed = 00:00:11 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 929 ; free virtual = 69825
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start RTL Component Statistics
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Detailed RTL Component Info :
|
|
||||||
+---Adders :
|
|
||||||
2 Input 12 Bit Adders := 8
|
|
||||||
2 Input 9 Bit Adders := 2
|
|
||||||
2 Input 8 Bit Adders := 2
|
|
||||||
2 Input 6 Bit Adders := 1
|
|
||||||
2 Input 5 Bit Adders := 4
|
|
||||||
2 Input 4 Bit Adders := 4
|
|
||||||
2 Input 2 Bit Adders := 2
|
|
||||||
+---Registers :
|
|
||||||
66 Bit Registers := 4
|
|
||||||
57 Bit Registers := 1
|
|
||||||
47 Bit Registers := 2
|
|
||||||
32 Bit Registers := 3
|
|
||||||
14 Bit Registers := 2
|
|
||||||
12 Bit Registers := 9
|
|
||||||
9 Bit Registers := 2
|
|
||||||
8 Bit Registers := 3
|
|
||||||
6 Bit Registers := 1
|
|
||||||
5 Bit Registers := 4
|
|
||||||
4 Bit Registers := 8
|
|
||||||
3 Bit Registers := 3
|
|
||||||
2 Bit Registers := 9
|
|
||||||
1 Bit Registers := 43
|
|
||||||
+---Muxes :
|
|
||||||
2 Input 66 Bit Muxes := 4
|
|
||||||
2 Input 47 Bit Muxes := 2
|
|
||||||
4 Input 32 Bit Muxes := 3
|
|
||||||
2 Input 32 Bit Muxes := 9
|
|
||||||
2 Input 14 Bit Muxes := 2
|
|
||||||
2 Input 12 Bit Muxes := 6
|
|
||||||
2 Input 9 Bit Muxes := 4
|
|
||||||
2 Input 8 Bit Muxes := 1
|
|
||||||
2 Input 6 Bit Muxes := 1
|
|
||||||
2 Input 5 Bit Muxes := 4
|
|
||||||
2 Input 4 Bit Muxes := 18
|
|
||||||
2 Input 2 Bit Muxes := 17
|
|
||||||
4 Input 2 Bit Muxes := 4
|
|
||||||
2 Input 1 Bit Muxes := 37
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished RTL Component Statistics
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Part Resource Summary
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Part Resources:
|
|
||||||
DSPs: 900 (col length:140)
|
|
||||||
BRAMs: 1000 (col length: RAMB18 140 RAMB36 70)
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Part Resource Summary
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Cross Boundary and Area Optimization
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
WARNING: [Synth 8-7080] Parallel synthesis criteria is not met
|
|
||||||
INFO: [Synth 8-3936] Found unconnected internal register 'inst/gen_axilite.gen_b2s_conv.axilite_b2s/SI_REG/aw.aw_pipe/m_payload_i_reg' and it is trimmed from '66' to '62' bits. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1726]
|
|
||||||
INFO: [Synth 8-3936] Found unconnected internal register 'inst/gen_axilite.gen_b2s_conv.axilite_b2s/SI_REG/ar.ar_pipe/m_payload_i_reg' and it is trimmed from '66' to '62' bits. [/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.gen/sources_1/bd/system/ipshared/ff9f/hdl/axi_register_slice_v2_1_vl_rfs.v:1726]
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_EXT.ACT_LO_EXT/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d5) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_EXT.ACT_LO_EXT/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d6) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_IN_cdc_to) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d2) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d3) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d4) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d5) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (EXT_LPF/ACTIVE_LOW_AUX.ACT_LO_AUX/GENERATE_LEVEL_P_S_CDC.SINGLE_BIT.CROSS_PLEVEL_IN2SCNDRY_s_level_out_d6) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (FDRE_inst) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (BSR_OUT_DFF[0].FDRE_BSR) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (ACTIVE_LOW_BSR_OUT_DFF[0].FDRE_BSR_N) is unused and will be removed from module proc_sys_reset.
|
|
||||||
WARNING: [Synth 8-3332] Sequential element (PR_OUT_DFF[0].FDRE_PER) is unused and will be removed from module proc_sys_reset.
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Cross Boundary and Area Optimization : Time (s): cpu = 00:00:12 ; elapsed = 00:00:12 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1838 ; free virtual = 70743
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Applying XDC Timing Constraints
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Applying XDC Timing Constraints : Time (s): cpu = 00:00:14 ; elapsed = 00:00:15 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1815 ; free virtual = 70747
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Timing Optimization
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Timing Optimization : Time (s): cpu = 00:00:14 ; elapsed = 00:00:15 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1781 ; free virtual = 70713
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Technology Mapping
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Technology Mapping : Time (s): cpu = 00:00:14 ; elapsed = 00:00:15 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1765 ; free virtual = 70711
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start IO Insertion
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Flattening Before IO Insertion
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Flattening Before IO Insertion
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Final Netlist Cleanup
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Final Netlist Cleanup
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished IO Insertion : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70517
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Renaming Generated Instances
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Renaming Generated Instances : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70517
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Rebuilding User Hierarchy
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Rebuilding User Hierarchy : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70516
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Renaming Generated Ports
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Renaming Generated Ports : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70516
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Handling Custom Attributes
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Handling Custom Attributes : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70516
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Renaming Generated Nets
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Renaming Generated Nets : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70516
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start ROM, RAM, DSP, Shift Register and Retiming Reporting
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Dynamic Shift Register Report:
|
|
||||||
+------------+----------------+--------+------------+--------+---------+--------+--------+--------+
|
|
||||||
|Module Name | RTL Name | Length | Data Width | SRL16E | SRLC32E | Mux F7 | Mux F8 | Mux F9 |
|
|
||||||
+------------+----------------+--------+------------+--------+---------+--------+--------+--------+
|
|
||||||
|dsrl | memory_reg[3] | 20 | 20 | 20 | 0 | 0 | 0 | 0 |
|
|
||||||
|dsrl__1 | memory_reg[3] | 2 | 2 | 2 | 0 | 0 | 0 | 0 |
|
|
||||||
|dsrl__2 | memory_reg[31] | 34 | 34 | 0 | 34 | 0 | 0 | 0 |
|
|
||||||
|dsrl__3 | memory_reg[31] | 13 | 13 | 0 | 13 | 0 | 0 | 0 |
|
|
||||||
+------------+----------------+--------+------------+--------+---------+--------+--------+--------+
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished ROM, RAM, DSP, Shift Register and Retiming Reporting
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Start Writing Synthesis Report
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Report BlackBoxes:
|
|
||||||
+-+--------------+----------+
|
|
||||||
| |BlackBox name |Instances |
|
|
||||||
+-+--------------+----------+
|
|
||||||
+-+--------------+----------+
|
|
||||||
|
|
||||||
Report Cell Usage:
|
|
||||||
+------+---------+------+
|
|
||||||
| |Cell |Count |
|
|
||||||
+------+---------+------+
|
|
||||||
|1 |BIBUF | 130|
|
|
||||||
|2 |BUFG | 1|
|
|
||||||
|3 |CARRY4 | 6|
|
|
||||||
|4 |DNA_PORT | 1|
|
|
||||||
|5 |LUT1 | 69|
|
|
||||||
|6 |LUT2 | 24|
|
|
||||||
|7 |LUT3 | 169|
|
|
||||||
|8 |LUT4 | 52|
|
|
||||||
|9 |LUT5 | 71|
|
|
||||||
|10 |LUT6 | 118|
|
|
||||||
|11 |PS7 | 1|
|
|
||||||
|12 |SRL16 | 1|
|
|
||||||
|13 |SRL16E | 16|
|
|
||||||
|14 |SRLC32E | 45|
|
|
||||||
|15 |FDCE | 66|
|
|
||||||
|16 |FDR | 4|
|
|
||||||
|17 |FDRE | 501|
|
|
||||||
|18 |FDSE | 20|
|
|
||||||
|19 |LD | 57|
|
|
||||||
|20 |IOBUF | 33|
|
|
||||||
+------+---------+------+
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Finished Writing Synthesis Report : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1541 ; free virtual = 70516
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
Synthesis finished with 0 errors, 0 critical warnings and 136 warnings.
|
|
||||||
Synthesis Optimization Runtime : Time (s): cpu = 00:00:14 ; elapsed = 00:00:15 . Memory (MB): peak = 2518.902 ; gain = 618.598 ; free physical = 1531 ; free virtual = 70510
|
|
||||||
Synthesis Optimization Complete : Time (s): cpu = 00:00:16 ; elapsed = 00:00:17 . Memory (MB): peak = 2518.902 ; gain = 781.078 ; free physical = 1531 ; free virtual = 70509
|
|
||||||
INFO: [Project 1-571] Translating synthesized netlist
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00.01 ; elapsed = 00:00:00.02 . Memory (MB): peak = 2518.902 ; gain = 0.000 ; free physical = 1748 ; free virtual = 70732
|
|
||||||
INFO: [Netlist 29-17] Analyzing 101 Unisim elements for replacement
|
|
||||||
INFO: [Netlist 29-28] Unisim Transformation completed in 0 CPU seconds
|
|
||||||
INFO: [Project 1-570] Preparing netlist for logic optimization
|
|
||||||
INFO: [Opt 31-138] Pushed 0 inverter(s) to 0 load pin(s).
|
|
||||||
Netlist sorting complete. Time (s): cpu = 00:00:00 ; elapsed = 00:00:00 . Memory (MB): peak = 2563.766 ; gain = 0.000 ; free physical = 1757 ; free virtual = 70743
|
|
||||||
INFO: [Project 1-111] Unisim Transformation Summary:
|
|
||||||
A total of 95 instances were transformed.
|
|
||||||
FDR => FDRE: 4 instances
|
|
||||||
IOBUF => IOBUF (IBUF, OBUFT): 33 instances
|
|
||||||
LD => LDCE: 57 instances
|
|
||||||
SRL16 => SRL16E: 1 instance
|
|
||||||
|
|
||||||
Synth Design complete | Checksum: 8993d7c
|
|
||||||
INFO: [Common 17-83] Releasing license: Synthesis
|
|
||||||
187 Infos, 142 Warnings, 0 Critical Warnings and 0 Errors encountered.
|
|
||||||
synth_design completed successfully
|
|
||||||
synth_design: Time (s): cpu = 00:00:20 ; elapsed = 00:00:19 . Memory (MB): peak = 2563.801 ; gain = 1259.379 ; free physical = 1759 ; free virtual = 70746
|
|
||||||
INFO: [Common 17-2834] synth_design peak Physical Memory [PSS] (MB): overall = 1991.605; main = 1727.861; forked = 379.983
|
|
||||||
INFO: [Common 17-2834] synth_design peak Virtual Memory [VSS] (MB): overall = 3465.613; main = 2563.770; forked = 1042.766
|
|
||||||
Write ShapeDB Complete: Time (s): cpu = 00:00:00 ; elapsed = 00:00:00.01 . Memory (MB): peak = 2611.777 ; gain = 0.000 ; free physical = 1758 ; free virtual = 70746
|
|
||||||
INFO: [Common 17-1381] The checkpoint '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Debug_FW.runs/synth_1/system_wrapper.dcp' has been generated.
|
|
||||||
INFO: [runtcl-4] Executing : report_utilization -file system_wrapper_utilization_synth.rpt -pb system_wrapper_utilization_synth.pb
|
|
||||||
INFO: [Common 17-206] Exiting Vivado at Wed May 27 16:36:31 2026...
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +0,0 @@
|
|||||||
#-----------------------------------------------------------
|
|
||||||
# Webtalk v2018.3 (64-bit)
|
|
||||||
# SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
|
|
||||||
#
|
|
||||||
# Start of session at: Mon Jan 12 17:58:43 2026
|
|
||||||
# Process ID: 9264
|
|
||||||
# Current directory: E:/CALBOARD/z035_mars1k_a1_sc1/calboard_cp_a1/proj_cal/proj_cal.sdk/webtalk
|
|
||||||
# Command line: wbtcv.exe -mode batch -source sdk_webtalk.tcl
|
|
||||||
# Log file: E:/CALBOARD/z035_mars1k_a1_sc1/calboard_cp_a1/proj_cal/proj_cal.sdk/webtalk/webtalk.log
|
|
||||||
# Journal file: E:/CALBOARD/z035_mars1k_a1_sc1/calboard_cp_a1/proj_cal/proj_cal.sdk/webtalk\webtalk.jou
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
source sdk_webtalk.tcl
|
|
||||||
# webtalk_init -webtalk_dir E:\\CALBOARD\\z035_mars1k_a1_sc1\\calboard_cp_a1\\proj_cal\\proj_cal.sdk\\webtalk
|
|
||||||
# webtalk_register_client -client project
|
|
||||||
# webtalk_add_data -client project -key date_generated -value "2026-01-12 17:58:41" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key product_version -value "SDK v2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key build_version -value "2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_platform -value "amd64" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key registration_id -value "" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key tool_flow -value "SDK" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key beta -value "false" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key route_design -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_family -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_device -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_package -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_speed -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key random_id -value "2nggfjdmptbjko2tf7jbetillv" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_id -value "2018.3_84" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_iteration -value "84" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_name -value "Microsoft Windows 8 or later , 64-bit" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key os_release -value "major release (build 9200)" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_name -value "Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_speed -value "3096 MHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key total_processors -value "1" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key system_ram -value "68.455 GB" -context "user_environment"
|
|
||||||
# webtalk_register_client -client sdk
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1768211353816" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key isZynq -value "true" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key isZynqMP -value "false" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key Processors -value "2" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key VivadoVersion -value "2018.3" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key Arch -value "zynq" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key Device -value "7z035" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key IsHandoff -value "true" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "NA" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "NA" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "HWCreation" -context "sdk\\\\hardware/1768211353816"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "NA" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "ToolUsage" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key BootgenCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key DebugCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key PerfCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key FlashCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key CrossTriggCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_add_data -client sdk -key QemuDebugCount -value "0" -context "sdk\\\\bsp/1768211921541"
|
|
||||||
# webtalk_transmit -clientid 5615683 -regid "" -xml E:\\CALBOARD\\z035_mars1k_a1_sc1\\calboard_cp_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.xml -html E:\\CALBOARD\\z035_mars1k_a1_sc1\\calboard_cp_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.html -wdm E:\\CALBOARD\\z035_mars1k_a1_sc1\\calboard_cp_a1\\proj_cal\\proj_cal.sdk\\webtalk\\sdk_webtalk.wdm -intro "<H3>SDK Usage Report</H3><BR>"
|
|
||||||
# webtalk_terminate
|
|
||||||
INFO: [Common 17-206] Exiting Webtalk at Mon Jan 12 17:58:45 2026...
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
#-----------------------------------------------------------
|
|
||||||
# Webtalk v2018.3 (64-bit)
|
|
||||||
# SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
|
|
||||||
#
|
|
||||||
# Start of session at: Thu Jul 20 18:23:39 2023
|
|
||||||
# Process ID: 20184
|
|
||||||
# Current directory: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk
|
|
||||||
# Command line: wbtcv.exe -mode batch -source sdk_webtalk.tcl
|
|
||||||
# Log file: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk/webtalk.log
|
|
||||||
# Journal file: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk\webtalk.jou
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
source sdk_webtalk.tcl
|
|
||||||
# webtalk_init -webtalk_dir G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk
|
|
||||||
# webtalk_register_client -client project
|
|
||||||
# webtalk_add_data -client project -key date_generated -value "2023-07-20 18:23:36" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key product_version -value "SDK v2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key build_version -value "2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_platform -value "amd64" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key registration_id -value "" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key tool_flow -value "SDK" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key beta -value "false" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key route_design -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_family -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_device -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_package -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_speed -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key random_id -value "d93rb3douagiiu2qng7tjq9f0f" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_id -value "2018.3_39" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_iteration -value "39" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_name -value "Microsoft Windows 8 or later , 64-bit" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key os_release -value "major release (build 9200)" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_name -value "Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_speed -value "3096 MHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key total_processors -value "1" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key system_ram -value "16.915 GB" -context "user_environment"
|
|
||||||
# webtalk_register_client -client sdk
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1689821971742" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key isZynq -value "true" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key isZynqMP -value "false" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key Processors -value "2" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key VivadoVersion -value "2018.3" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key Arch -value "zynq" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key Device -value "7z035" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key IsHandoff -value "true" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "NA" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "NA" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "HWCreation" -context "sdk\\\\hardware/1689821971742"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1689822029590" -context "sdk\\\\bsp/1689822029590"
|
|
||||||
# webtalk_add_data -client sdk -key hwid -value "1689821971742" -context "sdk\\\\bsp/1689822029590"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "standalone" -context "sdk\\\\bsp/1689822029590"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "lwip_echo_server" -context "sdk\\\\bsp/1689822029590"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "BSPCreation" -context "sdk\\\\bsp/1689822029590"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1689822033349" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key hwid -value "1689821971742" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key bspid -value "1689822029590" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key newbsp -value "true" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "standalone" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "lwip_echo_server" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "APPCreation" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key LangUsed -value "C" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key Procused -value "ps7_cortexa9" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key projSize -value "1030.41015625" -context "sdk\\\\application/1689822033349"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "NA" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "ToolUsage" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key BootgenCount -value "0" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key DebugCount -value "19" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key PerfCount -value "0" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key FlashCount -value "0" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key CrossTriggCount -value "0" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_add_data -client sdk -key QemuDebugCount -value "0" -context "sdk\\\\bsp/1689848616439"
|
|
||||||
# webtalk_transmit -clientid 3912584924 -regid "" -xml G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.xml -html G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.html -wdm G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\sdk_webtalk.wdm -intro "<H3>SDK Usage Report</H3><BR>"
|
|
||||||
# webtalk_terminate
|
|
||||||
INFO: [Common 17-206] Exiting Webtalk at Thu Jul 20 18:23:42 2023...
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
#-----------------------------------------------------------
|
|
||||||
# Webtalk v2018.3 (64-bit)
|
|
||||||
# SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
|
|
||||||
#
|
|
||||||
# Start of session at: Mon Jul 31 11:37:17 2023
|
|
||||||
# Process ID: 5900
|
|
||||||
# Current directory: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk
|
|
||||||
# Command line: wbtcv.exe -mode batch -source sdk_webtalk.tcl
|
|
||||||
# Log file: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk/webtalk.log
|
|
||||||
# Journal file: G:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk\webtalk.jou
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
source sdk_webtalk.tcl
|
|
||||||
# webtalk_init -webtalk_dir G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk
|
|
||||||
# webtalk_register_client -client project
|
|
||||||
# webtalk_add_data -client project -key date_generated -value "2023-07-31 11:37:16" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key product_version -value "SDK v2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key build_version -value "2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_platform -value "amd64" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key registration_id -value "" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key tool_flow -value "SDK" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key beta -value "false" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key route_design -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_family -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_device -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_package -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_speed -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key random_id -value "6lutd0oqhp462m5qicot7tp33v" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_id -value "2018.3_40" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_iteration -value "40" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_name -value "Microsoft Windows 8 or later , 64-bit" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key os_release -value "major release (build 9200)" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_name -value "Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_speed -value "3096 MHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key total_processors -value "1" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key system_ram -value "16.915 GB" -context "user_environment"
|
|
||||||
# webtalk_register_client -client sdk
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1690773826104" -context "sdk\\\\bsp/1690773826104"
|
|
||||||
# webtalk_add_data -client sdk -key hwid -value "1689821971742" -context "sdk\\\\bsp/1690773826104"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "standalone" -context "sdk\\\\bsp/1690773826104"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "zynq_fsbl" -context "sdk\\\\bsp/1690773826104"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "BSPCreation" -context "sdk\\\\bsp/1690773826104"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1690773834491" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key hwid -value "1689821971742" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key bspid -value "1690773826104" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key newbsp -value "true" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "standalone" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "zynq_fsbl" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "APPCreation" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key LangUsed -value "C" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key Procused -value "ps7_cortexa9" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key projSize -value "593.01953125" -context "sdk\\\\application/1690773834491"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "NA" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "ToolUsage" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key BootgenCount -value "1" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key DebugCount -value "0" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key PerfCount -value "0" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key FlashCount -value "0" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key CrossTriggCount -value "0" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_add_data -client sdk -key QemuDebugCount -value "0" -context "sdk\\\\bsp/1690774636169"
|
|
||||||
# webtalk_transmit -clientid 2374953459 -regid "" -xml G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.xml -html G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.html -wdm G:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\sdk_webtalk.wdm -intro "<H3>SDK Usage Report</H3><BR>"
|
|
||||||
# webtalk_terminate
|
|
||||||
INFO: [Common 17-206] Exiting Webtalk at Mon Jul 31 11:37:19 2023...
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
#-----------------------------------------------------------
|
|
||||||
# Webtalk v2018.3 (64-bit)
|
|
||||||
# SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
|
|
||||||
#
|
|
||||||
# Start of session at: Fri Nov 22 13:59:32 2024
|
|
||||||
# Process ID: 7548
|
|
||||||
# Current directory: E:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk
|
|
||||||
# Command line: wbtcv.exe -mode batch -source sdk_webtalk.tcl
|
|
||||||
# Log file: E:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk/webtalk.log
|
|
||||||
# Journal file: E:/CALBOARD/z035_mars1k/calboard_a1/proj_cal/proj_cal.sdk/webtalk\webtalk.jou
|
|
||||||
#-----------------------------------------------------------
|
|
||||||
source sdk_webtalk.tcl
|
|
||||||
# webtalk_init -webtalk_dir E:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk
|
|
||||||
# webtalk_register_client -client project
|
|
||||||
# webtalk_add_data -client project -key date_generated -value "2024-11-22 13:59:31" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key product_version -value "SDK v2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key build_version -value "2018.3" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_platform -value "amd64" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key registration_id -value "" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key tool_flow -value "SDK" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key beta -value "false" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key route_design -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_family -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_device -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_package -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key target_speed -value "NA" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key random_id -value "um90256p7r8dnau11ussq547e5" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_id -value "2018.3_78" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key project_iteration -value "78" -context "software_version_and_target_device"
|
|
||||||
# webtalk_add_data -client project -key os_name -value "Microsoft Windows 8 or later , 64-bit" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key os_release -value "major release (build 9200)" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_name -value "Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key cpu_speed -value "3096 MHz" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key total_processors -value "1" -context "user_environment"
|
|
||||||
# webtalk_add_data -client project -key system_ram -value "68.455 GB" -context "user_environment"
|
|
||||||
# webtalk_register_client -client sdk
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "1732254221461" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key isZynq -value "true" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key isZynqMP -value "false" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key Processors -value "2" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key VivadoVersion -value "2018.3" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key Arch -value "zynq" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key Device -value "7z035" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key IsHandoff -value "true" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key os -value "NA" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key apptemplate -value "NA" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "HWCreation" -context "sdk\\\\hardware/1732254221461"
|
|
||||||
# webtalk_add_data -client sdk -key uid -value "NA" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key RecordType -value "ToolUsage" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key BootgenCount -value "1" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key DebugCount -value "0" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key PerfCount -value "0" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key FlashCount -value "0" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key CrossTriggCount -value "0" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_add_data -client sdk -key QemuDebugCount -value "0" -context "sdk\\\\bsp/1732255170972"
|
|
||||||
# webtalk_transmit -clientid 61313245 -regid "" -xml E:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.xml -html E:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\usage_statistics_ext_sdk.html -wdm E:\\CALBOARD\\z035_mars1k\\calboard_a1\\proj_cal\\proj_cal.sdk\\webtalk\\sdk_webtalk.wdm -intro "<H3>SDK Usage Report</H3><BR>"
|
|
||||||
# webtalk_terminate
|
|
||||||
INFO: [Common 17-206] Exiting Webtalk at Fri Nov 22 13:59:37 2024...
|
|
||||||
@@ -1,4 +1,14 @@
|
|||||||
timestamp=[2026-05-27 09:47:20], mode=WORKBENCH_START, duration=0:00:02.140, duration_ms=2140, data={}
|
timestamp=[2026-05-28 18:29:18], mode=PLATFORM_GENERATION, duration=0:00:15.265, duration_ms=15265, data={name=NewInstCal_bsp}
|
||||||
timestamp=[2026-05-27 09:47:20], mode=PLATFORM_REPOSITORY_INIT, duration=0:00:00.014, duration_ms=14, data={}
|
timestamp=[2026-05-28 18:29:21], mode=BUILD, duration=0:00:02.313, duration_ms=2313, data={name=NewInstrCalBoard_system, configuration=Debug, clean_build=false}
|
||||||
timestamp=[2026-05-27 09:47:20], mode=WORKBENCH_UI_INIT, duration=0:00:00.170, duration_ms=170, data={editors_count=0, platform_editors_count=0, projects_count=0, platform_projects_count=0, active_platform_editor=false, projects=}
|
timestamp=[2026-05-28 18:29:49], mode=PLATFORM_GENERATION, duration=0:00:12.429, duration_ms=12429, data={name=NewInstCal_bsp}
|
||||||
timestamp=[2026-05-27 09:48:49], mode=PLATFORM_GENERATION, duration=0:00:10.747, duration_ms=10747, data={name=NewInstCal_bsp}
|
timestamp=[2026-05-28 18:30:07], mode=PLATFORM_GENERATION, duration=0:00:07.057, duration_ms=7057, data={name=NewInstCal_bsp}
|
||||||
|
timestamp=[2026-05-28 18:30:39], mode=PLATFORM_GENERATION, duration=0:00:21.949, duration_ms=21949, data={name=NewInstCal_bsp}
|
||||||
|
timestamp=[2026-05-28 18:31:05], mode=PLATFORM_GENERATION, duration=0:00:11.136, duration_ms=11136, data={name=NewInstCal_bsp}
|
||||||
|
timestamp=[2026-05-28 18:32:23], mode=PLATFORM_GENERATION, duration=0:00:22.520, duration_ms=22520, data={name=NewInstCal_bsp}
|
||||||
|
timestamp=[2026-05-28 18:32:41], mode=BUILD, duration=0:00:01.927, duration_ms=1927, data={name=NewInstrCalBoard, configuration=Debug, clean_build=false}
|
||||||
|
timestamp=[2026-05-28 18:35:48], mode=BUILD, duration=0:00:00.239, duration_ms=239, data={name=NewInstrCalBoard, configuration=Debug, clean_build=true}
|
||||||
|
timestamp=[2026-05-28 18:35:51], mode=BUILD, duration=0:00:02.453, duration_ms=2453, data={name=NewInstrCalBoard, configuration=Debug, clean_build=false}
|
||||||
|
timestamp=[2026-05-28 18:36:02], mode=BUILD, duration=0:00:02.193, duration_ms=2193, data={name=NewInstrCalBoard, configuration=Debug, clean_build=false}
|
||||||
|
timestamp=[2026-05-28 18:36:10], mode=BUILD, duration=0:00:06.939, duration_ms=6939, data={name=NewInstrCalBoard_system, configuration=Debug, clean_build=false}
|
||||||
|
timestamp=[2026-05-28 18:36:18], mode=BUILD, duration=0:00:01.197, duration_ms=1197, data={name=NewInstrCalBoard, configuration=Debug, clean_build=false}
|
||||||
|
timestamp=[2026-05-28 18:36:25], mode=BUILD, duration=0:00:06.800, duration_ms=6800, data={name=NewInstrCalBoard_system, configuration=Debug, clean_build=false}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
09:47:19 DEBUG : Logs will be stored at '/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Vitis_Classic/IDE.log'.
|
|
||||||
09:47:20 INFO : Launching XSCT server: xsct -n -interactive /home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Vitis_Classic/temp_xsdb_launch_script.tcl
|
|
||||||
09:47:20 INFO : Platform repository initialization has completed.
|
|
||||||
09:47:20 INFO : Registering command handlers for Vitis TCF services
|
|
||||||
09:47:21 INFO : XSCT server has started successfully.
|
|
||||||
09:47:21 INFO : Successfully done setting XSCT server connection channel
|
|
||||||
09:47:21 INFO : Successfully done query RDI_DATADIR
|
|
||||||
09:47:21 INFO : Successfully done setting workspace for the tool.
|
|
||||||
09:47:22 INFO : plnx-install-location is set to ''
|
|
||||||
09:48:02 INFO : Platform 'NewInstCal_bsp' is added to custom repositories.
|
|
||||||
09:48:28 INFO : Hardware specification for platform project 'NewInstCal_bsp' is updated.
|
|
||||||
09:48:46 INFO : Result from executing command 'getProjects': NewInstCal_bsp
|
|
||||||
09:48:46 INFO : Result from executing command 'getPlatforms': NewInstCal_bsp|/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Vitis_Classic/NewInstCal_bsp/export/NewInstCal_bsp/NewInstCal_bsp.xpfm
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
2026-05-27T18:04:35.5315588000-Nothing to build in platform 'NewInstCal_bsp'
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
|||||||
{"platformName":"NewInstCal_bsp","sprVersion":"2.0","mode":"gui","dsaType":"Fixed","platformDesc":"NewInstCal_bsp","platHandOff":"/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Vitis_Classic/system_wrapper.xsa","platIntHandOff":"<platformDir>/hw/system_wrapper.xsa","deviceType":"zynq","platIsPrebuiltAutogen":"false","platIsNoBootBsp":"false","hasFsblMakeHasChanges":"false","hasPmufwMakeHasChanges":"false","fsblExtraCompilerFlags":"-MMD -MP -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard ","platPreBuiltFlag":false,"platformSamplesDir":"","platActiveSys":"NewInstCal_bsp","systems":[{"systemName":"NewInstCal_bsp","systemDesc":"NewInstCal_bsp","sysIsBootAutoGen":"true","systemDispName":"NewInstCal_bsp","sysActiveDom":"standalone_domain","sysDefaultDom":"standalone_domain","domains":[{"domainName":"zynq_fsbl","domainDispName":"zynq_fsbl","domainDesc":"FSBL Application BSP - Auto Generated.","processors":"ps7_cortexa9_0","os":"standalone","sdxOs":"standalone","debugEnable":"","domRuntimes":["cpp"],"swRepo":"","mssOsVer":"9.0","mssFile":"","md5Digest":"3243e54020e3af7b58d483729f3822a1","compatibleApp":"zynq_fsbl","domType":"bootDomain","arch":"32-bit","appSettings":{"appCompilerFlags":"","appLinkerFlags":""},"addedLibs":["xilffs:5.1","xilrsa:1.7"],"libOptions":{"libsContainingOptions":[]},"prebuiltLibs":{"prebuiltIncPath":[],"prebuiltLibPath":[]},"isolation":{}},{"domainName":"standalone_domain","domainDispName":"standalone on ps7_cortexa9_0","domainDesc":"standalone_domain","processors":"ps7_cortexa9_0","os":"standalone","sdxOs":"standalone","qemuArgs":"<platformDir>/resources/NewInstCal_bsp/standalone_domain/qemu_args.txt","qemuData":"<platformDir>/resources/NewInstCal_bsp/standalone_domain/qemu","debugEnable":"False","domRuntimes":["cpp"],"swRepo":"","mssOsVer":"9.0","mssFile":"","md5Digest":"1422839dbecb6fdfcf744dce689d156a","compatibleApp":"","domType":"mssDomain","appSettings":{"appCompilerFlags":"","appLinkerFlags":""},"addedLibs":["lwip213:1.1"],"libOptions":{"libsContainingOptions":[]},"prebuiltLibs":{"prebuiltIncPath":[],"prebuiltLibPath":[]},"isolation":{}}]}]}
|
{"platformName":"NewInstCal_bsp","sprVersion":"2.0","mode":"gui","dsaType":"Fixed","platformDesc":"NewInstCal_bsp","platHandOff":"/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW/Vitis_Classic/system_wrapper.xsa","platIntHandOff":"<platformDir>/hw/system_wrapper.xsa","deviceType":"zynq","platIsPrebuiltAutogen":"false","platIsNoBootBsp":"false","hasFsblMakeHasChanges":"false","hasPmufwMakeHasChanges":"false","fsblExtraCompilerFlags":"-MMD -MP -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard ","platPreBuiltFlag":false,"platformSamplesDir":"","platActiveSys":"NewInstCal_bsp","systems":[{"systemName":"NewInstCal_bsp","systemDesc":"NewInstCal_bsp","sysIsBootAutoGen":"true","systemDispName":"NewInstCal_bsp","sysActiveDom":"standalone_domain","sysDefaultDom":"standalone_domain","domains":[{"domainName":"zynq_fsbl","domainDispName":"zynq_fsbl","domainDesc":"FSBL Application BSP - Auto Generated.","processors":"ps7_cortexa9_0","os":"standalone","sdxOs":"standalone","debugEnable":"","domRuntimes":["cpp"],"swRepo":"","mssOsVer":"9.0","mssFile":"","md5Digest":"3243e54020e3af7b58d483729f3822a1","compatibleApp":"zynq_fsbl","domType":"bootDomain","arch":"32-bit","appSettings":{"appCompilerFlags":"","appLinkerFlags":""},"addedLibs":["xilffs:5.1","xilrsa:1.7"],"libOptions":{"libsContainingOptions":[]},"prebuiltLibs":{"prebuiltIncPath":[],"prebuiltLibPath":[]},"isolation":{}},{"domainName":"standalone_domain","domainDispName":"standalone on ps7_cortexa9_0","domainDesc":"standalone_domain","processors":"ps7_cortexa9_0","os":"standalone","sdxOs":"standalone","qemuArgs":"<platformDir>/resources/NewInstCal_bsp/standalone_domain/qemu_args.txt","qemuData":"<platformDir>/resources/NewInstCal_bsp/standalone_domain/qemu","debugEnable":"False","domRuntimes":["cpp"],"swRepo":"","mssOsVer":"9.0","mssFile":"","md5Digest":"870cf67c4823e845fc8ac789403ae247","compatibleApp":"","domType":"mssDomain","appSettings":{"appCompilerFlags":"","appLinkerFlags":""},"addedLibs":[],"libOptions":{"libsContainingOptions":[]},"prebuiltLibs":{"prebuiltIncPath":[],"prebuiltLibPath":[]},"isolation":{}}]}]}
|
||||||
|
|||||||
@@ -29,3 +29,18 @@ platform config -updatehw {/home/ly0kos/work/prj/New_CalBoard/2.FW/Zynq/Debug_FW
|
|||||||
platform generate
|
platform generate
|
||||||
platform active {NewInstCal_bsp}
|
platform active {NewInstCal_bsp}
|
||||||
platform generate
|
platform generate
|
||||||
|
platform active {NewInstCal_bsp}
|
||||||
|
platform generate
|
||||||
|
platform clean
|
||||||
|
platform active {NewInstCal_bsp}
|
||||||
|
domain active {zynq_fsbl}
|
||||||
|
bsp reload
|
||||||
|
catch {bsp regenerate}
|
||||||
|
domain active {standalone_domain}
|
||||||
|
bsp reload
|
||||||
|
bsp removelib -name lwip213
|
||||||
|
bsp write
|
||||||
|
bsp reload
|
||||||
|
catch {bsp regenerate}
|
||||||
|
catch {bsp regenerate}
|
||||||
|
platform generate
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ PROCESSOR = ps7_cortexa9_0
|
|||||||
LIBRARIES = ${PROCESSOR}/lib/libxil.a
|
LIBRARIES = ${PROCESSOR}/lib/libxil.a
|
||||||
BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
|
BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
|
||||||
SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
|
SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
|
||||||
BSP_SEQUENTIAL_MAKEFILES := ps7_cortexa9_0/libsrc/lwip213_v1_1/src/Makefile
|
BSP_SEQUENTIAL_MAKEFILES :=
|
||||||
BSP_PARALLEL_MAKEFILES := $(filter-out $(BSP_SEQUENTIAL_MAKEFILES),$(BSP_MAKEFILES))
|
BSP_PARALLEL_MAKEFILES := $(filter-out $(BSP_SEQUENTIAL_MAKEFILES),$(BSP_MAKEFILES))
|
||||||
SEQ_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_SEQUENTIAL_MAKEFILES))
|
SEQ_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_SEQUENTIAL_MAKEFILES))
|
||||||
PAR_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_PARALLEL_MAKEFILES))
|
PAR_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_PARALLEL_MAKEFILES))
|
||||||
|
|||||||
-83
@@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* Copyright (C) 2007 - 2022 Xilinx, Inc.
|
|
||||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ARCH_CC_H__
|
|
||||||
#define __ARCH_CC_H__
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "lwipopts.h"
|
|
||||||
|
|
||||||
/** if you want to use the struct timeval provided
|
|
||||||
* by your system, set this to 0 and include <sys/time.h> in cc.h */
|
|
||||||
#define LWIP_TIMEVAL_PRIVATE 0
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "cpu.h"
|
|
||||||
|
|
||||||
/* As per new design of lwip-2.0.2,
|
|
||||||
* LWIP_NO_STDINT_H should be defined as 1 in cc.h */
|
|
||||||
#define LWIP_NO_STDINT_H 1
|
|
||||||
|
|
||||||
typedef unsigned char u8_t;
|
|
||||||
typedef signed char s8_t;
|
|
||||||
typedef unsigned short u16_t;
|
|
||||||
typedef signed short s16_t;
|
|
||||||
typedef unsigned int u32_t;
|
|
||||||
typedef signed int s32_t;
|
|
||||||
typedef unsigned long long u64_t;
|
|
||||||
typedef signed long long s64_t;
|
|
||||||
|
|
||||||
#define S16_F "d"
|
|
||||||
#define U16_F "d"
|
|
||||||
#define S32_F "d"
|
|
||||||
#define U32_F "x"
|
|
||||||
|
|
||||||
#define X16_F "x"
|
|
||||||
#define X32_F "x"
|
|
||||||
|
|
||||||
#define LWIP_RAND rand
|
|
||||||
|
|
||||||
typedef unsigned long mem_ptr_t;
|
|
||||||
|
|
||||||
#define PACK_STRUCT_FIELD(x) x
|
|
||||||
#define PACK_STRUCT_STRUCT __attribute__((packed))
|
|
||||||
#define PACK_STRUCT_BEGIN
|
|
||||||
#define PACK_STRUCT_END
|
|
||||||
|
|
||||||
#define LWIP_PLATFORM_ASSERT(x)
|
|
||||||
#define LWIP_PLATFORM_DIAG(x) do { xil_printf x; } while(0)
|
|
||||||
|
|
||||||
#endif /* __ARCH_CC_H__ */
|
|
||||||
-49
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* Copyright (C) 2007 - 2022 Xilinx, Inc.
|
|
||||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ARCH_CPU_H__
|
|
||||||
#define __ARCH_CPU_H__
|
|
||||||
|
|
||||||
#include "lwipopts.h"
|
|
||||||
|
|
||||||
#ifndef BYTE_ORDER
|
|
||||||
#ifdef PROCESSOR_LITTLE_ENDIAN
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
|
||||||
#else
|
|
||||||
#define BYTE_ORDER BIG_ENDIAN
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ARCH_CPU_H__ */
|
|
||||||
-52
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* Copyright (C) 2007 - 2022 Xilinx, Inc.
|
|
||||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ARCH_PERF_H__
|
|
||||||
#define __ARCH_PERF_H__
|
|
||||||
|
|
||||||
#define PERF_START /* null definition */
|
|
||||||
#define PERF_STOP(x) /* null definition */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void perf_init(char *fname);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ARCH_PERF_H__ */
|
|
||||||
-74
@@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* Copyright (C) 2007 - 2022 Xilinx, Inc.
|
|
||||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __SYS_XILINX_ARCH_H__
|
|
||||||
#define __SYS_XILINX_ARCH_H__
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#include "lwipopts.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if !NO_SYS
|
|
||||||
|
|
||||||
#include "FreeRTOS.h"
|
|
||||||
#include "task.h"
|
|
||||||
#include "queue.h"
|
|
||||||
#include "semphr.h"
|
|
||||||
#include "timers.h"
|
|
||||||
|
|
||||||
#define SYS_MBOX_NULL ( ( xQueueHandle ) NULL )
|
|
||||||
#define SYS_SEM_NULL ( ( xSemaphoreHandle ) NULL )
|
|
||||||
#define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE
|
|
||||||
|
|
||||||
typedef xSemaphoreHandle sys_sem_t;
|
|
||||||
typedef xSemaphoreHandle sys_mutex_t;
|
|
||||||
typedef xQueueHandle sys_mbox_t;
|
|
||||||
typedef xTaskHandle sys_thread_t;
|
|
||||||
|
|
||||||
typedef unsigned long sys_prot_t;
|
|
||||||
|
|
||||||
#define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
|
|
||||||
#define sys_mbox_set_invalid( x ) ( ( *x ) = NULL )
|
|
||||||
#define sys_sem_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
|
|
||||||
#define sys_sem_set_invalid( x ) ( ( *x ) = NULL )
|
|
||||||
#endif /* !NO_SYS */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __SYS_XILINX_ARCH_H__ */
|
|
||||||
-206
@@ -1,206 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP connection API (to be used from TCPIP thread)\n
|
|
||||||
*
|
|
||||||
* This file contains the generic API.
|
|
||||||
* For more details see @ref altcp_api.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ALTCP_H
|
|
||||||
#define LWIP_HDR_ALTCP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/tcpbase.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct altcp_pcb;
|
|
||||||
struct altcp_functions;
|
|
||||||
|
|
||||||
typedef err_t (*altcp_accept_fn)(void *arg, struct altcp_pcb *new_conn, err_t err);
|
|
||||||
typedef err_t (*altcp_connected_fn)(void *arg, struct altcp_pcb *conn, err_t err);
|
|
||||||
typedef err_t (*altcp_recv_fn)(void *arg, struct altcp_pcb *conn, struct pbuf *p, err_t err);
|
|
||||||
typedef err_t (*altcp_sent_fn)(void *arg, struct altcp_pcb *conn, u16_t len);
|
|
||||||
typedef err_t (*altcp_poll_fn)(void *arg, struct altcp_pcb *conn);
|
|
||||||
typedef void (*altcp_err_fn)(void *arg, err_t err);
|
|
||||||
|
|
||||||
typedef struct altcp_pcb* (*altcp_new_fn)(void *arg, u8_t ip_type);
|
|
||||||
|
|
||||||
struct altcp_pcb {
|
|
||||||
const struct altcp_functions *fns;
|
|
||||||
struct altcp_pcb *inner_conn;
|
|
||||||
void *arg;
|
|
||||||
void *state;
|
|
||||||
/* application callbacks */
|
|
||||||
altcp_accept_fn accept;
|
|
||||||
altcp_connected_fn connected;
|
|
||||||
altcp_recv_fn recv;
|
|
||||||
altcp_sent_fn sent;
|
|
||||||
altcp_poll_fn poll;
|
|
||||||
altcp_err_fn err;
|
|
||||||
u8_t pollinterval;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @ingroup altcp */
|
|
||||||
typedef struct altcp_allocator_s {
|
|
||||||
/** Allocator function */
|
|
||||||
altcp_new_fn alloc;
|
|
||||||
/** Argument to allocator function */
|
|
||||||
void *arg;
|
|
||||||
} altcp_allocator_t;
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_new(altcp_allocator_t *allocator);
|
|
||||||
struct altcp_pcb *altcp_new_ip6(altcp_allocator_t *allocator);
|
|
||||||
struct altcp_pcb *altcp_new_ip_type(altcp_allocator_t *allocator, u8_t ip_type);
|
|
||||||
|
|
||||||
void altcp_arg(struct altcp_pcb *conn, void *arg);
|
|
||||||
void altcp_accept(struct altcp_pcb *conn, altcp_accept_fn accept);
|
|
||||||
void altcp_recv(struct altcp_pcb *conn, altcp_recv_fn recv);
|
|
||||||
void altcp_sent(struct altcp_pcb *conn, altcp_sent_fn sent);
|
|
||||||
void altcp_poll(struct altcp_pcb *conn, altcp_poll_fn poll, u8_t interval);
|
|
||||||
void altcp_err(struct altcp_pcb *conn, altcp_err_fn err);
|
|
||||||
|
|
||||||
void altcp_recved(struct altcp_pcb *conn, u16_t len);
|
|
||||||
err_t altcp_bind(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);
|
|
||||||
err_t altcp_connect(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected);
|
|
||||||
|
|
||||||
/* return conn for source code compatibility to tcp callback API only */
|
|
||||||
struct altcp_pcb *altcp_listen_with_backlog_and_err(struct altcp_pcb *conn, u8_t backlog, err_t *err);
|
|
||||||
#define altcp_listen_with_backlog(conn, backlog) altcp_listen_with_backlog_and_err(conn, backlog, NULL)
|
|
||||||
/** @ingroup altcp */
|
|
||||||
#define altcp_listen(conn) altcp_listen_with_backlog_and_err(conn, TCP_DEFAULT_LISTEN_BACKLOG, NULL)
|
|
||||||
|
|
||||||
void altcp_abort(struct altcp_pcb *conn);
|
|
||||||
err_t altcp_close(struct altcp_pcb *conn);
|
|
||||||
err_t altcp_shutdown(struct altcp_pcb *conn, int shut_rx, int shut_tx);
|
|
||||||
|
|
||||||
err_t altcp_write(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);
|
|
||||||
err_t altcp_output(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
u16_t altcp_mss(struct altcp_pcb *conn);
|
|
||||||
u16_t altcp_sndbuf(struct altcp_pcb *conn);
|
|
||||||
u16_t altcp_sndqueuelen(struct altcp_pcb *conn);
|
|
||||||
void altcp_nagle_disable(struct altcp_pcb *conn);
|
|
||||||
void altcp_nagle_enable(struct altcp_pcb *conn);
|
|
||||||
int altcp_nagle_disabled(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
void altcp_setprio(struct altcp_pcb *conn, u8_t prio);
|
|
||||||
|
|
||||||
err_t altcp_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
|
|
||||||
ip_addr_t *altcp_get_ip(struct altcp_pcb *conn, int local);
|
|
||||||
u16_t altcp_get_port(struct altcp_pcb *conn, int local);
|
|
||||||
|
|
||||||
#if LWIP_TCP_KEEPALIVE
|
|
||||||
void altcp_keepalive_disable(struct altcp_pcb *conn);
|
|
||||||
void altcp_keepalive_enable(struct altcp_pcb *conn, u32_t idle, u32_t intvl, u32_t count);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
enum tcp_state altcp_dbg_get_tcp_state(struct altcp_pcb *conn);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* LWIP_ALTCP */
|
|
||||||
|
|
||||||
/* ALTCP disabled, define everything to link against tcp callback API (e.g. to get a small non-ssl httpd) */
|
|
||||||
|
|
||||||
#include "lwip/tcp.h"
|
|
||||||
|
|
||||||
#define altcp_accept_fn tcp_accept_fn
|
|
||||||
#define altcp_connected_fn tcp_connected_fn
|
|
||||||
#define altcp_recv_fn tcp_recv_fn
|
|
||||||
#define altcp_sent_fn tcp_sent_fn
|
|
||||||
#define altcp_poll_fn tcp_poll_fn
|
|
||||||
#define altcp_err_fn tcp_err_fn
|
|
||||||
|
|
||||||
#define altcp_pcb tcp_pcb
|
|
||||||
#define altcp_tcp_new_ip_type tcp_new_ip_type
|
|
||||||
#define altcp_tcp_new tcp_new
|
|
||||||
#define altcp_tcp_new_ip6 tcp_new_ip6
|
|
||||||
|
|
||||||
#define altcp_new(allocator) tcp_new()
|
|
||||||
#define altcp_new_ip6(allocator) tcp_new_ip6()
|
|
||||||
#define altcp_new_ip_type(allocator, ip_type) tcp_new_ip_type(ip_type)
|
|
||||||
|
|
||||||
#define altcp_arg tcp_arg
|
|
||||||
#define altcp_accept tcp_accept
|
|
||||||
#define altcp_recv tcp_recv
|
|
||||||
#define altcp_sent tcp_sent
|
|
||||||
#define altcp_poll tcp_poll
|
|
||||||
#define altcp_err tcp_err
|
|
||||||
|
|
||||||
#define altcp_recved tcp_recved
|
|
||||||
#define altcp_bind tcp_bind
|
|
||||||
#define altcp_connect tcp_connect
|
|
||||||
|
|
||||||
#define altcp_listen_with_backlog_and_err tcp_listen_with_backlog_and_err
|
|
||||||
#define altcp_listen_with_backlog tcp_listen_with_backlog
|
|
||||||
#define altcp_listen tcp_listen
|
|
||||||
|
|
||||||
#define altcp_abort tcp_abort
|
|
||||||
#define altcp_close tcp_close
|
|
||||||
#define altcp_shutdown tcp_shutdown
|
|
||||||
|
|
||||||
#define altcp_write tcp_write
|
|
||||||
#define altcp_output tcp_output
|
|
||||||
|
|
||||||
#define altcp_mss tcp_mss
|
|
||||||
#define altcp_sndbuf tcp_sndbuf
|
|
||||||
#define altcp_sndqueuelen tcp_sndqueuelen
|
|
||||||
#define altcp_nagle_disable tcp_nagle_disable
|
|
||||||
#define altcp_nagle_enable tcp_nagle_enable
|
|
||||||
#define altcp_nagle_disabled tcp_nagle_disabled
|
|
||||||
#define altcp_setprio tcp_setprio
|
|
||||||
|
|
||||||
#define altcp_get_tcp_addrinfo tcp_get_tcp_addrinfo
|
|
||||||
#define altcp_get_ip(pcb, local) ((local) ? (&(pcb)->local_ip) : (&(pcb)->remote_ip))
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
#define altcp_dbg_get_tcp_state tcp_dbg_get_tcp_state
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ALTCP_H */
|
|
||||||
-72
@@ -1,72 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP connection API (to be used from TCPIP thread)\n
|
|
||||||
* This interface mimics the tcp callback API to the application while preventing
|
|
||||||
* direct linking (much like virtual functions).
|
|
||||||
* This way, an application can make use of other application layer protocols
|
|
||||||
* on top of TCP without knowing the details (e.g. TLS, proxy connection).
|
|
||||||
*
|
|
||||||
* This file contains the base implementation calling into tcp.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ALTCP_TCP_H
|
|
||||||
#define LWIP_HDR_ALTCP_TCP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/altcp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_tcp_new_ip_type(u8_t ip_type);
|
|
||||||
|
|
||||||
#define altcp_tcp_new() altcp_tcp_new_ip_type(IPADDR_TYPE_V4)
|
|
||||||
#define altcp_tcp_new_ip6() altcp_tcp_new_ip_type(IPADDR_TYPE_V6)
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_tcp_alloc(void *arg, u8_t ip_type);
|
|
||||||
|
|
||||||
struct tcp_pcb;
|
|
||||||
struct altcp_pcb *altcp_tcp_wrap(struct tcp_pcb *tpcb);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ALTCP_TCP_H */
|
|
||||||
-143
@@ -1,143 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP/TLS connection API (to be used from TCPIP thread)
|
|
||||||
*
|
|
||||||
* @defgroup altcp_tls TLS layer
|
|
||||||
* @ingroup altcp
|
|
||||||
* This file contains function prototypes for a TLS layer.
|
|
||||||
* A port to ARM mbedtls is provided in the apps/ tree
|
|
||||||
* (LWIP_ALTCP_TLS_MBEDTLS option).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ALTCP_TLS_H
|
|
||||||
#define LWIP_HDR_ALTCP_TLS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#if LWIP_ALTCP_TLS
|
|
||||||
|
|
||||||
#include "lwip/altcp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* ALTCP_TLS configuration handle, content depends on port (e.g. mbedtls)
|
|
||||||
*/
|
|
||||||
struct altcp_tls_config;
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create an ALTCP_TLS server configuration handle prepared for multiple certificates
|
|
||||||
*/
|
|
||||||
struct altcp_tls_config *altcp_tls_create_config_server(uint8_t cert_count);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Add a certificate to an ALTCP_TLS server configuration handle
|
|
||||||
*/
|
|
||||||
err_t altcp_tls_config_server_add_privkey_cert(struct altcp_tls_config *config,
|
|
||||||
const u8_t *privkey, size_t privkey_len,
|
|
||||||
const u8_t *privkey_pass, size_t privkey_pass_len,
|
|
||||||
const u8_t *cert, size_t cert_len);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create an ALTCP_TLS server configuration handle with one certificate
|
|
||||||
* (short version of calling @ref altcp_tls_create_config_server and
|
|
||||||
* @ref altcp_tls_config_server_add_privkey_cert)
|
|
||||||
*/
|
|
||||||
struct altcp_tls_config *altcp_tls_create_config_server_privkey_cert(const u8_t *privkey, size_t privkey_len,
|
|
||||||
const u8_t *privkey_pass, size_t privkey_pass_len,
|
|
||||||
const u8_t *cert, size_t cert_len);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create an ALTCP_TLS client configuration handle
|
|
||||||
*/
|
|
||||||
struct altcp_tls_config *altcp_tls_create_config_client(const u8_t *cert, size_t cert_len);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create an ALTCP_TLS client configuration handle with two-way server/client authentication
|
|
||||||
*/
|
|
||||||
struct altcp_tls_config *altcp_tls_create_config_client_2wayauth(const u8_t *ca, size_t ca_len, const u8_t *privkey, size_t privkey_len,
|
|
||||||
const u8_t *privkey_pass, size_t privkey_pass_len,
|
|
||||||
const u8_t *cert, size_t cert_len);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Free an ALTCP_TLS configuration handle
|
|
||||||
*/
|
|
||||||
void altcp_tls_free_config(struct altcp_tls_config *conf);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Free an ALTCP_TLS global entropy instance.
|
|
||||||
* All ALTCP_TLS configuration are linked to one altcp_tls_entropy_rng structure
|
|
||||||
* that handle an unique system entropy & ctr_drbg instance.
|
|
||||||
* This function allow application to free this altcp_tls_entropy_rng structure
|
|
||||||
* when all configuration referencing it were destroyed.
|
|
||||||
* This function does nothing if some ALTCP_TLS configuration handle are still
|
|
||||||
* active.
|
|
||||||
*/
|
|
||||||
void altcp_tls_free_entropy(void);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create new ALTCP_TLS layer wrapping an existing pcb as inner connection (e.g. TLS over TCP)
|
|
||||||
*/
|
|
||||||
struct altcp_pcb *altcp_tls_wrap(struct altcp_tls_config *config, struct altcp_pcb *inner_pcb);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create new ALTCP_TLS pcb and its inner tcp pcb
|
|
||||||
*/
|
|
||||||
struct altcp_pcb *altcp_tls_new(struct altcp_tls_config *config, u8_t ip_type);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Create new ALTCP_TLS layer pcb and its inner tcp pcb.
|
|
||||||
* Same as @ref altcp_tls_new but this allocator function fits to
|
|
||||||
* @ref altcp_allocator_t / @ref altcp_new.\n
|
|
||||||
'arg' must contain a struct altcp_tls_config *.
|
|
||||||
*/
|
|
||||||
struct altcp_pcb *altcp_tls_alloc(void *arg, u8_t ip_type);
|
|
||||||
|
|
||||||
/** @ingroup altcp_tls
|
|
||||||
* Return pointer to internal TLS context so application can tweak it.
|
|
||||||
* Real type depends on port (e.g. mbedtls)
|
|
||||||
*/
|
|
||||||
void *altcp_tls_context(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP_TLS */
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
#endif /* LWIP_HDR_ALTCP_TLS_H */
|
|
||||||
-431
@@ -1,431 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* netconn API (to be used from non-TCPIP threads)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_API_H
|
|
||||||
#define LWIP_HDR_API_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
/* Note: Netconn API is always available when sockets are enabled -
|
|
||||||
* sockets are implemented on top of them */
|
|
||||||
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
#include "lwip/netbuf.h"
|
|
||||||
#include "lwip/sys.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Throughout this file, IP addresses and port numbers are expected to be in
|
|
||||||
* the same byte order as in the corresponding pcb.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Flags for netconn_write (u8_t) */
|
|
||||||
#define NETCONN_NOFLAG 0x00
|
|
||||||
#define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */
|
|
||||||
#define NETCONN_COPY 0x01
|
|
||||||
#define NETCONN_MORE 0x02
|
|
||||||
#define NETCONN_DONTBLOCK 0x04
|
|
||||||
#define NETCONN_NOAUTORCVD 0x08 /* prevent netconn_recv_data_tcp() from updating the tcp window - must be done manually via netconn_tcp_recvd() */
|
|
||||||
#define NETCONN_NOFIN 0x10 /* upper layer already received data, leave FIN in queue until called again */
|
|
||||||
|
|
||||||
/* Flags for struct netconn.flags (u8_t) */
|
|
||||||
/** This netconn had an error, don't block on recvmbox/acceptmbox any more */
|
|
||||||
#define NETCONN_FLAG_MBOXCLOSED 0x01
|
|
||||||
/** Should this netconn avoid blocking? */
|
|
||||||
#define NETCONN_FLAG_NON_BLOCKING 0x02
|
|
||||||
/** Was the last connect action a non-blocking one? */
|
|
||||||
#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04
|
|
||||||
#if LWIP_NETCONN_FULLDUPLEX
|
|
||||||
/** The mbox of this netconn is being deallocated, don't use it anymore */
|
|
||||||
#define NETCONN_FLAG_MBOXINVALID 0x08
|
|
||||||
#endif /* LWIP_NETCONN_FULLDUPLEX */
|
|
||||||
/** If a nonblocking write has been rejected before, poll_tcp needs to
|
|
||||||
check if the netconn is writable again */
|
|
||||||
#define NETCONN_FLAG_CHECK_WRITESPACE 0x10
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** If this flag is set then only IPv6 communication is allowed on the
|
|
||||||
netconn. As per RFC#3493 this features defaults to OFF allowing
|
|
||||||
dual-stack usage by default. */
|
|
||||||
#define NETCONN_FLAG_IPV6_V6ONLY 0x20
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
#if LWIP_NETBUF_RECVINFO
|
|
||||||
/** Received packet info will be recorded for this netconn */
|
|
||||||
#define NETCONN_FLAG_PKTINFO 0x40
|
|
||||||
#endif /* LWIP_NETBUF_RECVINFO */
|
|
||||||
/** A FIN has been received but not passed to the application yet */
|
|
||||||
#define NETCONN_FIN_RX_PENDING 0x80
|
|
||||||
|
|
||||||
/* Helpers to process several netconn_types by the same code */
|
|
||||||
#define NETCONNTYPE_GROUP(t) ((t)&0xF0)
|
|
||||||
#define NETCONNTYPE_DATAGRAM(t) ((t)&0xE0)
|
|
||||||
#if LWIP_IPV6
|
|
||||||
#define NETCONN_TYPE_IPV6 0x08
|
|
||||||
#define NETCONNTYPE_ISIPV6(t) (((t)&NETCONN_TYPE_IPV6) != 0)
|
|
||||||
#define NETCONNTYPE_ISUDPLITE(t) (((t)&0xF3) == NETCONN_UDPLITE)
|
|
||||||
#define NETCONNTYPE_ISUDPNOCHKSUM(t) (((t)&0xF3) == NETCONN_UDPNOCHKSUM)
|
|
||||||
#else /* LWIP_IPV6 */
|
|
||||||
#define NETCONNTYPE_ISIPV6(t) (0)
|
|
||||||
#define NETCONNTYPE_ISUDPLITE(t) ((t) == NETCONN_UDPLITE)
|
|
||||||
#define NETCONNTYPE_ISUDPNOCHKSUM(t) ((t) == NETCONN_UDPNOCHKSUM)
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** @ingroup netconn_common
|
|
||||||
* Protocol family and type of the netconn
|
|
||||||
*/
|
|
||||||
enum netconn_type {
|
|
||||||
NETCONN_INVALID = 0,
|
|
||||||
/** TCP IPv4 */
|
|
||||||
NETCONN_TCP = 0x10,
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** TCP IPv6 */
|
|
||||||
NETCONN_TCP_IPV6 = NETCONN_TCP | NETCONN_TYPE_IPV6 /* 0x18 */,
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
/** UDP IPv4 */
|
|
||||||
NETCONN_UDP = 0x20,
|
|
||||||
/** UDP IPv4 lite */
|
|
||||||
NETCONN_UDPLITE = 0x21,
|
|
||||||
/** UDP IPv4 no checksum */
|
|
||||||
NETCONN_UDPNOCHKSUM = 0x22,
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** UDP IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */
|
|
||||||
NETCONN_UDP_IPV6 = NETCONN_UDP | NETCONN_TYPE_IPV6 /* 0x28 */,
|
|
||||||
/** UDP IPv6 lite (dual-stack by default, unless you call @ref netconn_set_ipv6only) */
|
|
||||||
NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | NETCONN_TYPE_IPV6 /* 0x29 */,
|
|
||||||
/** UDP IPv6 no checksum (dual-stack by default, unless you call @ref netconn_set_ipv6only) */
|
|
||||||
NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | NETCONN_TYPE_IPV6 /* 0x2a */,
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Raw connection IPv4 */
|
|
||||||
NETCONN_RAW = 0x40
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** Raw connection IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */
|
|
||||||
, NETCONN_RAW_IPV6 = NETCONN_RAW | NETCONN_TYPE_IPV6 /* 0x48 */
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Current state of the netconn. Non-TCP netconns are always
|
|
||||||
* in state NETCONN_NONE! */
|
|
||||||
enum netconn_state {
|
|
||||||
NETCONN_NONE,
|
|
||||||
NETCONN_WRITE,
|
|
||||||
NETCONN_LISTEN,
|
|
||||||
NETCONN_CONNECT,
|
|
||||||
NETCONN_CLOSE
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Used to inform the callback function about changes
|
|
||||||
*
|
|
||||||
* Event explanation:
|
|
||||||
*
|
|
||||||
* In the netconn implementation, there are three ways to block a client:
|
|
||||||
*
|
|
||||||
* - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept())
|
|
||||||
* - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data())
|
|
||||||
* - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write())
|
|
||||||
*
|
|
||||||
* The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking
|
|
||||||
* connections, you need to know in advance whether a call to a netconn function call would block or not,
|
|
||||||
* and these events tell you about that.
|
|
||||||
*
|
|
||||||
* RCVPLUS events say: Safe to perform a potentially blocking call call once more.
|
|
||||||
* They are counted in sockets - three RCVPLUS events for accept mbox means you are safe
|
|
||||||
* to call netconn_accept 3 times without being blocked.
|
|
||||||
* Same thing for receive mbox.
|
|
||||||
*
|
|
||||||
* RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged".
|
|
||||||
* Socket implementation decrements the counter.
|
|
||||||
*
|
|
||||||
* For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something.
|
|
||||||
* SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again.
|
|
||||||
* A SENDMINUS event occurs when the next call to a netconn_send() would be blocking.
|
|
||||||
*/
|
|
||||||
enum netconn_evt {
|
|
||||||
NETCONN_EVT_RCVPLUS,
|
|
||||||
NETCONN_EVT_RCVMINUS,
|
|
||||||
NETCONN_EVT_SENDPLUS,
|
|
||||||
NETCONN_EVT_SENDMINUS,
|
|
||||||
NETCONN_EVT_ERROR
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
|
||||||
/** Used for netconn_join_leave_group() */
|
|
||||||
enum netconn_igmp {
|
|
||||||
NETCONN_JOIN,
|
|
||||||
NETCONN_LEAVE
|
|
||||||
};
|
|
||||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
|
||||||
|
|
||||||
#if LWIP_DNS
|
|
||||||
/* Used for netconn_gethostbyname_addrtype(), these should match the DNS_ADDRTYPE defines in dns.h */
|
|
||||||
#define NETCONN_DNS_DEFAULT NETCONN_DNS_IPV4_IPV6
|
|
||||||
#define NETCONN_DNS_IPV4 0
|
|
||||||
#define NETCONN_DNS_IPV6 1
|
|
||||||
#define NETCONN_DNS_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */
|
|
||||||
#define NETCONN_DNS_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */
|
|
||||||
#endif /* LWIP_DNS */
|
|
||||||
|
|
||||||
/* forward-declare some structs to avoid to include their headers */
|
|
||||||
struct ip_pcb;
|
|
||||||
struct tcp_pcb;
|
|
||||||
struct udp_pcb;
|
|
||||||
struct raw_pcb;
|
|
||||||
struct netconn;
|
|
||||||
struct api_msg;
|
|
||||||
|
|
||||||
/** A callback prototype to inform about events for a netconn */
|
|
||||||
typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len);
|
|
||||||
|
|
||||||
/** A netconn descriptor */
|
|
||||||
struct netconn {
|
|
||||||
/** type of the netconn (TCP, UDP or RAW) */
|
|
||||||
enum netconn_type type;
|
|
||||||
/** current state of the netconn */
|
|
||||||
enum netconn_state state;
|
|
||||||
/** the lwIP internal protocol control block */
|
|
||||||
union {
|
|
||||||
struct ip_pcb *ip;
|
|
||||||
struct tcp_pcb *tcp;
|
|
||||||
struct udp_pcb *udp;
|
|
||||||
struct raw_pcb *raw;
|
|
||||||
} pcb;
|
|
||||||
/** the last asynchronous unreported error this netconn had */
|
|
||||||
err_t pending_err;
|
|
||||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
|
||||||
/** sem that is used to synchronously execute functions in the core context */
|
|
||||||
sys_sem_t op_completed;
|
|
||||||
#endif
|
|
||||||
/** mbox where received packets are stored until they are fetched
|
|
||||||
by the netconn application thread (can grow quite big) */
|
|
||||||
sys_mbox_t recvmbox;
|
|
||||||
#if LWIP_TCP
|
|
||||||
/** mbox where new connections are stored until processed
|
|
||||||
by the application thread */
|
|
||||||
sys_mbox_t acceptmbox;
|
|
||||||
#endif /* LWIP_TCP */
|
|
||||||
#if LWIP_NETCONN_FULLDUPLEX
|
|
||||||
/** number of threads waiting on an mbox. This is required to unblock
|
|
||||||
all threads when closing while threads are waiting. */
|
|
||||||
int mbox_threads_waiting;
|
|
||||||
#endif
|
|
||||||
/** only used for socket layer */
|
|
||||||
#if LWIP_SOCKET
|
|
||||||
int socket;
|
|
||||||
#endif /* LWIP_SOCKET */
|
|
||||||
#if LWIP_SO_SNDTIMEO
|
|
||||||
/** timeout to wait for sending data (which means enqueueing data for sending
|
|
||||||
in internal buffers) in milliseconds */
|
|
||||||
s32_t send_timeout;
|
|
||||||
#endif /* LWIP_SO_RCVTIMEO */
|
|
||||||
#if LWIP_SO_RCVTIMEO
|
|
||||||
/** timeout in milliseconds to wait for new data to be received
|
|
||||||
(or connections to arrive for listening netconns) */
|
|
||||||
u32_t recv_timeout;
|
|
||||||
#endif /* LWIP_SO_RCVTIMEO */
|
|
||||||
#if LWIP_SO_RCVBUF
|
|
||||||
/** maximum amount of bytes queued in recvmbox
|
|
||||||
not used for TCP: adjust TCP_WND instead! */
|
|
||||||
int recv_bufsize;
|
|
||||||
/** number of bytes currently in recvmbox to be received,
|
|
||||||
tested against recv_bufsize to limit bytes on recvmbox
|
|
||||||
for UDP and RAW, used for FIONREAD */
|
|
||||||
int recv_avail;
|
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
|
||||||
#if LWIP_SO_LINGER
|
|
||||||
/** values <0 mean linger is disabled, values > 0 are seconds to linger */
|
|
||||||
s16_t linger;
|
|
||||||
#endif /* LWIP_SO_LINGER */
|
|
||||||
/** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */
|
|
||||||
u8_t flags;
|
|
||||||
#if LWIP_TCP
|
|
||||||
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
|
|
||||||
this temporarily stores the message.
|
|
||||||
Also used during connect and close. */
|
|
||||||
struct api_msg *current_msg;
|
|
||||||
#endif /* LWIP_TCP */
|
|
||||||
/** A callback function that is informed about events for this netconn */
|
|
||||||
netconn_callback callback;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** This vector type is passed to @ref netconn_write_vectors_partly to send
|
|
||||||
* multiple buffers at once.
|
|
||||||
* ATTENTION: This type has to directly map struct iovec since one is casted
|
|
||||||
* into the other!
|
|
||||||
*/
|
|
||||||
struct netvector {
|
|
||||||
/** pointer to the application buffer that contains the data to send */
|
|
||||||
const void *ptr;
|
|
||||||
/** size of the application data to send */
|
|
||||||
size_t len;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Register an Network connection event */
|
|
||||||
#define API_EVENT(c,e,l) if (c->callback) { \
|
|
||||||
(*c->callback)(c, e, l); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Network connection functions: */
|
|
||||||
|
|
||||||
/** @ingroup netconn_common
|
|
||||||
* Create new netconn connection
|
|
||||||
* @param t @ref netconn_type */
|
|
||||||
#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL)
|
|
||||||
#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)
|
|
||||||
struct netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
|
|
||||||
netconn_callback callback);
|
|
||||||
err_t netconn_prepare_delete(struct netconn *conn);
|
|
||||||
err_t netconn_delete(struct netconn *conn);
|
|
||||||
/** Get the type of a netconn (as enum netconn_type). */
|
|
||||||
#define netconn_type(conn) (conn->type)
|
|
||||||
|
|
||||||
err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr,
|
|
||||||
u16_t *port, u8_t local);
|
|
||||||
/** @ingroup netconn_common */
|
|
||||||
#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
|
|
||||||
/** @ingroup netconn_common */
|
|
||||||
#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
|
|
||||||
|
|
||||||
err_t netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port);
|
|
||||||
err_t netconn_bind_if(struct netconn *conn, u8_t if_idx);
|
|
||||||
err_t netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port);
|
|
||||||
err_t netconn_disconnect (struct netconn *conn);
|
|
||||||
err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog);
|
|
||||||
/** @ingroup netconn_tcp */
|
|
||||||
#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
|
|
||||||
err_t netconn_accept(struct netconn *conn, struct netconn **new_conn);
|
|
||||||
err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf);
|
|
||||||
err_t netconn_recv_udp_raw_netbuf(struct netconn *conn, struct netbuf **new_buf);
|
|
||||||
err_t netconn_recv_udp_raw_netbuf_flags(struct netconn *conn, struct netbuf **new_buf, u8_t apiflags);
|
|
||||||
err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf);
|
|
||||||
err_t netconn_recv_tcp_pbuf_flags(struct netconn *conn, struct pbuf **new_buf, u8_t apiflags);
|
|
||||||
err_t netconn_tcp_recvd(struct netconn *conn, size_t len);
|
|
||||||
err_t netconn_sendto(struct netconn *conn, struct netbuf *buf,
|
|
||||||
const ip_addr_t *addr, u16_t port);
|
|
||||||
err_t netconn_send(struct netconn *conn, struct netbuf *buf);
|
|
||||||
err_t netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
|
|
||||||
u8_t apiflags, size_t *bytes_written);
|
|
||||||
err_t netconn_write_vectors_partly(struct netconn *conn, struct netvector *vectors, u16_t vectorcnt,
|
|
||||||
u8_t apiflags, size_t *bytes_written);
|
|
||||||
/** @ingroup netconn_tcp */
|
|
||||||
#define netconn_write(conn, dataptr, size, apiflags) \
|
|
||||||
netconn_write_partly(conn, dataptr, size, apiflags, NULL)
|
|
||||||
err_t netconn_close(struct netconn *conn);
|
|
||||||
err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx);
|
|
||||||
|
|
||||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
|
||||||
err_t netconn_join_leave_group(struct netconn *conn, const ip_addr_t *multiaddr,
|
|
||||||
const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);
|
|
||||||
err_t netconn_join_leave_group_netif(struct netconn *conn, const ip_addr_t *multiaddr,
|
|
||||||
u8_t if_idx, enum netconn_igmp join_or_leave);
|
|
||||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
|
||||||
#if LWIP_DNS
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
err_t netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype);
|
|
||||||
#define netconn_gethostbyname(name, addr) netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT)
|
|
||||||
#else /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
|
|
||||||
#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype) netconn_gethostbyname(name, addr)
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
#endif /* LWIP_DNS */
|
|
||||||
|
|
||||||
err_t netconn_err(struct netconn *conn);
|
|
||||||
#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize)
|
|
||||||
|
|
||||||
#define netconn_set_flags(conn, set_flags) do { (conn)->flags = (u8_t)((conn)->flags | (set_flags)); } while(0)
|
|
||||||
#define netconn_clear_flags(conn, clr_flags) do { (conn)->flags = (u8_t)((conn)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
|
|
||||||
#define netconn_is_flag_set(conn, flag) (((conn)->flags & (flag)) != 0)
|
|
||||||
|
|
||||||
/** Set the blocking status of netconn calls (@todo: write/send is missing) */
|
|
||||||
#define netconn_set_nonblocking(conn, val) do { if(val) { \
|
|
||||||
netconn_set_flags(conn, NETCONN_FLAG_NON_BLOCKING); \
|
|
||||||
} else { \
|
|
||||||
netconn_clear_flags(conn, NETCONN_FLAG_NON_BLOCKING); }} while(0)
|
|
||||||
/** Get the blocking status of netconn calls (@todo: write/send is missing) */
|
|
||||||
#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0)
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** @ingroup netconn_common
|
|
||||||
* TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
|
|
||||||
*/
|
|
||||||
#define netconn_set_ipv6only(conn, val) do { if(val) { \
|
|
||||||
netconn_set_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); \
|
|
||||||
} else { \
|
|
||||||
netconn_clear_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); }} while(0)
|
|
||||||
/** @ingroup netconn_common
|
|
||||||
* TCP: Get the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
|
|
||||||
*/
|
|
||||||
#define netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0)
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#if LWIP_SO_SNDTIMEO
|
|
||||||
/** Set the send timeout in milliseconds */
|
|
||||||
#define netconn_set_sendtimeout(conn, timeout) ((conn)->send_timeout = (timeout))
|
|
||||||
/** Get the send timeout in milliseconds */
|
|
||||||
#define netconn_get_sendtimeout(conn) ((conn)->send_timeout)
|
|
||||||
#endif /* LWIP_SO_SNDTIMEO */
|
|
||||||
#if LWIP_SO_RCVTIMEO
|
|
||||||
/** Set the receive timeout in milliseconds */
|
|
||||||
#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout))
|
|
||||||
/** Get the receive timeout in milliseconds */
|
|
||||||
#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout)
|
|
||||||
#endif /* LWIP_SO_RCVTIMEO */
|
|
||||||
#if LWIP_SO_RCVBUF
|
|
||||||
/** Set the receive buffer in bytes */
|
|
||||||
#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize))
|
|
||||||
/** Get the receive buffer in bytes */
|
|
||||||
#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize)
|
|
||||||
#endif /* LWIP_SO_RCVBUF*/
|
|
||||||
|
|
||||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
|
||||||
void netconn_thread_init(void);
|
|
||||||
void netconn_thread_cleanup(void);
|
|
||||||
#else /* LWIP_NETCONN_SEM_PER_THREAD */
|
|
||||||
#define netconn_thread_init()
|
|
||||||
#define netconn_thread_cleanup()
|
|
||||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_NETCONN || LWIP_SOCKET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_API_H */
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
This directory contains application headers.
|
|
||||||
Every application shall provide one api file APP.h and optionally one options file APP_opts.h
|
|
||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP connection API that executes a proxy-connect.
|
|
||||||
*
|
|
||||||
* This file provides a starting layer that executes a proxy-connect e.g. to
|
|
||||||
* set up TLS connections through a http proxy.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H
|
|
||||||
#define LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct altcp_proxyconnect_config {
|
|
||||||
ip_addr_t proxy_addr;
|
|
||||||
u16_t proxy_port;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_proxyconnect_new(struct altcp_proxyconnect_config *config, struct altcp_pcb *inner_pcb);
|
|
||||||
struct altcp_pcb *altcp_proxyconnect_new_tcp(struct altcp_proxyconnect_config *config, u8_t ip_type);
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_proxyconnect_alloc(void *arg, u8_t ip_type);
|
|
||||||
|
|
||||||
#if LWIP_ALTCP_TLS
|
|
||||||
struct altcp_proxyconnect_tls_config {
|
|
||||||
struct altcp_proxyconnect_config proxy;
|
|
||||||
struct altcp_tls_config *tls_config;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_proxyconnect_tls_alloc(void *arg, u8_t ip_type);
|
|
||||||
#endif /* LWIP_ALTCP_TLS */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
#endif /* LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H */
|
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP/TLS connection API (to be used from TCPIP thread)
|
|
||||||
*
|
|
||||||
* This file contains options for an mbedtls port of the TLS layer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ALTCP_TLS_OPTS_H
|
|
||||||
#define LWIP_HDR_ALTCP_TLS_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/** LWIP_ALTCP_TLS_MBEDTLS==1: use mbedTLS for TLS support for altcp API
|
|
||||||
* mbedtls include directory must be reachable via include search path
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_ALTCP_TLS_MBEDTLS
|
|
||||||
#define LWIP_ALTCP_TLS_MBEDTLS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configure debug level of this file */
|
|
||||||
#ifndef ALTCP_MBEDTLS_DEBUG
|
|
||||||
#define ALTCP_MBEDTLS_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configure lwIP debug level of the mbedTLS library */
|
|
||||||
#ifndef ALTCP_MBEDTLS_LIB_DEBUG
|
|
||||||
#define ALTCP_MBEDTLS_LIB_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configure minimum internal debug level of the mbedTLS library */
|
|
||||||
#ifndef ALTCP_MBEDTLS_LIB_DEBUG_LEVEL_MIN
|
|
||||||
#define ALTCP_MBEDTLS_LIB_DEBUG_LEVEL_MIN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Enable the basic session cache
|
|
||||||
* ATTENTION: Using a session cache can lower security by reusing keys!
|
|
||||||
*/
|
|
||||||
#ifndef ALTCP_MBEDTLS_USE_SESSION_CACHE
|
|
||||||
#define ALTCP_MBEDTLS_USE_SESSION_CACHE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum cache size of the basic session cache */
|
|
||||||
#ifndef ALTCP_MBEDTLS_SESSION_CACHE_SIZE
|
|
||||||
#define ALTCP_MBEDTLS_SESSION_CACHE_SIZE 30
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set a session timeout in seconds for the basic session cache */
|
|
||||||
#ifndef ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS
|
|
||||||
#define ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS (60 * 60)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Use session tickets to speed up connection setup (needs
|
|
||||||
* MBEDTLS_SSL_SESSION_TICKETS enabled in mbedTLS config).
|
|
||||||
* ATTENTION: Using session tickets can lower security by reusing keys!
|
|
||||||
*/
|
|
||||||
#ifndef ALTCP_MBEDTLS_USE_SESSION_TICKETS
|
|
||||||
#define ALTCP_MBEDTLS_USE_SESSION_TICKETS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Session ticket cipher */
|
|
||||||
#ifndef ALTCP_MBEDTLS_SESSION_TICKET_CIPHER
|
|
||||||
#define ALTCP_MBEDTLS_SESSION_TICKET_CIPHER MBEDTLS_CIPHER_AES_256_GCM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum timeout for session tickets */
|
|
||||||
#ifndef ALTCP_MBEDTLS_SESSION_TICKET_TIMEOUT_SECONDS
|
|
||||||
#define ALTCP_MBEDTLS_SESSION_TICKET_TIMEOUT_SECONDS (60 * 60 * 24)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ALTCP_TLS_OPTS_H */
|
|
||||||
-126
@@ -1,126 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_FS_H
|
|
||||||
#define LWIP_HDR_APPS_FS_H
|
|
||||||
|
|
||||||
#include "httpd_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FS_READ_EOF -1
|
|
||||||
#define FS_READ_DELAYED -2
|
|
||||||
|
|
||||||
#if HTTPD_PRECALCULATED_CHECKSUM
|
|
||||||
struct fsdata_chksum {
|
|
||||||
u32_t offset;
|
|
||||||
u16_t chksum;
|
|
||||||
u16_t len;
|
|
||||||
};
|
|
||||||
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
|
|
||||||
|
|
||||||
#define FS_FILE_FLAGS_HEADER_INCLUDED 0x01
|
|
||||||
#define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02
|
|
||||||
#define FS_FILE_FLAGS_HEADER_HTTPVER_1_1 0x04
|
|
||||||
#define FS_FILE_FLAGS_SSI 0x08
|
|
||||||
|
|
||||||
/** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private
|
|
||||||
* pointer type (defaults to 'void' so the default usage is 'void*')
|
|
||||||
*/
|
|
||||||
#ifndef FS_FILE_EXTENSION_T_DEFINED
|
|
||||||
typedef void fs_file_extension;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct fs_file {
|
|
||||||
const char *data;
|
|
||||||
int len;
|
|
||||||
int index;
|
|
||||||
/* pextension is free for implementations to hold private (extensional)
|
|
||||||
arbitrary data, e.g. holding some file state or file system handle */
|
|
||||||
fs_file_extension *pextension;
|
|
||||||
#if HTTPD_PRECALCULATED_CHECKSUM
|
|
||||||
const struct fsdata_chksum *chksum;
|
|
||||||
u16_t chksum_count;
|
|
||||||
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
|
|
||||||
u8_t flags;
|
|
||||||
#if LWIP_HTTPD_CUSTOM_FILES
|
|
||||||
u8_t is_custom_file;
|
|
||||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
|
||||||
#if LWIP_HTTPD_FILE_STATE
|
|
||||||
void *state;
|
|
||||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
|
||||||
typedef void (*fs_wait_cb)(void *arg);
|
|
||||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
|
||||||
|
|
||||||
err_t fs_open(struct fs_file *file, const char *name);
|
|
||||||
void fs_close(struct fs_file *file);
|
|
||||||
#if LWIP_HTTPD_DYNAMIC_FILE_READ
|
|
||||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
|
||||||
int fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg);
|
|
||||||
#else /* LWIP_HTTPD_FS_ASYNC_READ */
|
|
||||||
int fs_read(struct fs_file *file, char *buffer, int count);
|
|
||||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
|
||||||
#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */
|
|
||||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
|
||||||
int fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg);
|
|
||||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
|
||||||
int fs_bytes_left(struct fs_file *file);
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_FILE_STATE
|
|
||||||
/** This user-defined function is called when a file is opened. */
|
|
||||||
void *fs_state_init(struct fs_file *file, const char *name);
|
|
||||||
/** This user-defined function is called when a file is closed. */
|
|
||||||
void fs_state_free(struct fs_file *file, void *state);
|
|
||||||
#endif /* #if LWIP_HTTPD_FILE_STATE */
|
|
||||||
|
|
||||||
struct fsdata_file {
|
|
||||||
const struct fsdata_file *next;
|
|
||||||
const unsigned char *name;
|
|
||||||
const unsigned char *data;
|
|
||||||
int len;
|
|
||||||
u8_t flags;
|
|
||||||
#if HTTPD_PRECALCULATED_CHECKSUM
|
|
||||||
u16_t chksum_count;
|
|
||||||
const struct fsdata_chksum *chksum;
|
|
||||||
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_FS_H */
|
|
||||||
-160
@@ -1,160 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* HTTP client
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_HTTP_CLIENT_H
|
|
||||||
#define LWIP_HDR_APPS_HTTP_CLIENT_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/altcp.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
|
|
||||||
#if LWIP_TCP && LWIP_CALLBACK_API
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpc
|
|
||||||
* HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly
|
|
||||||
* to disk via fopen/fwrite.
|
|
||||||
* These functions are example implementations of the interface only.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HTTPC_HAVE_FILE_IO
|
|
||||||
#define LWIP_HTTPC_HAVE_FILE_IO 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpc
|
|
||||||
* The default TCP port used for HTTP
|
|
||||||
*/
|
|
||||||
#define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpc
|
|
||||||
* HTTP client result codes
|
|
||||||
*/
|
|
||||||
typedef enum ehttpc_result {
|
|
||||||
/** File successfully received */
|
|
||||||
HTTPC_RESULT_OK = 0,
|
|
||||||
/** Unknown error */
|
|
||||||
HTTPC_RESULT_ERR_UNKNOWN = 1,
|
|
||||||
/** Connection to server failed */
|
|
||||||
HTTPC_RESULT_ERR_CONNECT = 2,
|
|
||||||
/** Failed to resolve server hostname */
|
|
||||||
HTTPC_RESULT_ERR_HOSTNAME = 3,
|
|
||||||
/** Connection unexpectedly closed by remote server */
|
|
||||||
HTTPC_RESULT_ERR_CLOSED = 4,
|
|
||||||
/** Connection timed out (server didn't respond in time) */
|
|
||||||
HTTPC_RESULT_ERR_TIMEOUT = 5,
|
|
||||||
/** Server responded with an error code */
|
|
||||||
HTTPC_RESULT_ERR_SVR_RESP = 6,
|
|
||||||
/** Local memory error */
|
|
||||||
HTTPC_RESULT_ERR_MEM = 7,
|
|
||||||
/** Local abort */
|
|
||||||
HTTPC_RESULT_LOCAL_ABORT = 8,
|
|
||||||
/** Content length mismatch */
|
|
||||||
HTTPC_RESULT_ERR_CONTENT_LEN = 9
|
|
||||||
} httpc_result_t;
|
|
||||||
|
|
||||||
typedef struct _httpc_state httpc_state_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpc
|
|
||||||
* Prototype of a http client callback function
|
|
||||||
*
|
|
||||||
* @param arg argument specified when initiating the request
|
|
||||||
* @param httpc_result result of the http transfer (see enum httpc_result_t)
|
|
||||||
* @param rx_content_len number of bytes received (without headers)
|
|
||||||
* @param srv_res this contains the http status code received (if any)
|
|
||||||
* @param err an error returned by internal lwip functions, can help to specify
|
|
||||||
* the source of the error but must not necessarily be != ERR_OK
|
|
||||||
*/
|
|
||||||
typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpc
|
|
||||||
* Prototype of http client callback: called when the headers are received
|
|
||||||
*
|
|
||||||
* @param connection http client connection
|
|
||||||
* @param arg argument specified when initiating the request
|
|
||||||
* @param hdr header pbuf(s) (may contain data also)
|
|
||||||
* @param hdr_len length of the heders in 'hdr'
|
|
||||||
* @param content_len content length as received in the headers (-1 if not received)
|
|
||||||
* @return if != ERR_OK is returned, the connection is aborted
|
|
||||||
*/
|
|
||||||
typedef err_t (*httpc_headers_done_fn)(httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len);
|
|
||||||
|
|
||||||
typedef struct _httpc_connection {
|
|
||||||
ip_addr_t proxy_addr;
|
|
||||||
u16_t proxy_port;
|
|
||||||
u8_t use_proxy;
|
|
||||||
/* @todo: add username:pass? */
|
|
||||||
|
|
||||||
#if LWIP_ALTCP
|
|
||||||
altcp_allocator_t *altcp_allocator;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* this callback is called when the transfer is finished (or aborted) */
|
|
||||||
httpc_result_fn result_fn;
|
|
||||||
/* this callback is called after receiving the http headers
|
|
||||||
It can abort the connection by returning != ERR_OK */
|
|
||||||
httpc_headers_done_fn headers_done_fn;
|
|
||||||
} httpc_connection_t;
|
|
||||||
|
|
||||||
err_t httpc_get_file(const ip_addr_t* server_addr, u16_t port, const char* uri, const httpc_connection_t *settings,
|
|
||||||
altcp_recv_fn recv_fn, void* callback_arg, httpc_state_t **connection);
|
|
||||||
err_t httpc_get_file_dns(const char* server_name, u16_t port, const char* uri, const httpc_connection_t *settings,
|
|
||||||
altcp_recv_fn recv_fn, void* callback_arg, httpc_state_t **connection);
|
|
||||||
|
|
||||||
#if LWIP_HTTPC_HAVE_FILE_IO
|
|
||||||
err_t httpc_get_file_to_disk(const ip_addr_t* server_addr, u16_t port, const char* uri, const httpc_connection_t *settings,
|
|
||||||
void* callback_arg, const char* local_file_name, httpc_state_t **connection);
|
|
||||||
err_t httpc_get_file_dns_to_disk(const char* server_name, u16_t port, const char* uri, const httpc_connection_t *settings,
|
|
||||||
void* callback_arg, const char* local_file_name, httpc_state_t **connection);
|
|
||||||
#endif /* LWIP_HTTPC_HAVE_FILE_IO */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_TCP && LWIP_CALLBACK_API */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_HTTP_CLIENT_H */
|
|
||||||
-255
@@ -1,255 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* HTTP server
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
* This version of the file has been modified by Texas Instruments to offer
|
|
||||||
* simple server-side-include (SSI) and Common Gateway Interface (CGI)
|
|
||||||
* capability.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_HTTPD_H
|
|
||||||
#define LWIP_HDR_APPS_HTTPD_H
|
|
||||||
|
|
||||||
#include "httpd_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_CGI
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Function pointer for a CGI script handler.
|
|
||||||
*
|
|
||||||
* This function is called each time the HTTPD server is asked for a file
|
|
||||||
* whose name was previously registered as a CGI function using a call to
|
|
||||||
* http_set_cgi_handlers. The iIndex parameter provides the index of the
|
|
||||||
* CGI within the cgis array passed to http_set_cgi_handlers. Parameters
|
|
||||||
* pcParam and pcValue provide access to the parameters provided along with
|
|
||||||
* the URI. iNumParams provides a count of the entries in the pcParam and
|
|
||||||
* pcValue arrays. Each entry in the pcParam array contains the name of a
|
|
||||||
* parameter with the corresponding entry in the pcValue array containing the
|
|
||||||
* value for that parameter. Note that pcParam may contain multiple elements
|
|
||||||
* with the same name if, for example, a multi-selection list control is used
|
|
||||||
* in the form generating the data.
|
|
||||||
*
|
|
||||||
* The function should return a pointer to a character string which is the
|
|
||||||
* path and filename of the response that is to be sent to the connected
|
|
||||||
* browser, for example "/thanks.htm" or "/response/error.ssi".
|
|
||||||
*
|
|
||||||
* The maximum number of parameters that will be passed to this function via
|
|
||||||
* iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in
|
|
||||||
* the incoming HTTP request above this number will be discarded.
|
|
||||||
*
|
|
||||||
* Requests intended for use by this CGI mechanism must be sent using the GET
|
|
||||||
* method (which encodes all parameters within the URI rather than in a block
|
|
||||||
* later in the request). Attempts to use the POST method will result in the
|
|
||||||
* request being ignored.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
|
|
||||||
char *pcValue[]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Structure defining the base filename (URL) of a CGI and the associated
|
|
||||||
* function which is to be called when that URL is requested.
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
const char *pcCGIName;
|
|
||||||
tCGIHandler pfnCGIHandler;
|
|
||||||
} tCGI;
|
|
||||||
|
|
||||||
void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers);
|
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_CGI */
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_CGI_SSI
|
|
||||||
/* we have to prototype this struct here to make it available for the handler */
|
|
||||||
struct fs_file;
|
|
||||||
|
|
||||||
/** Define this generic CGI handler in your application.
|
|
||||||
* It is called once for every URI with parameters.
|
|
||||||
* The parameters can be stored to the object passed as connection_state, which
|
|
||||||
* is allocated to file->state via fs_state_init() from fs_open() or fs_open_custom().
|
|
||||||
* Content creation via SSI or complete dynamic files can retrieve the CGI params from there.
|
|
||||||
*/
|
|
||||||
extern void httpd_cgi_handler(struct fs_file *file, const char* uri, int iNumParams,
|
|
||||||
char **pcParam, char **pcValue
|
|
||||||
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
|
||||||
, void *connection_state
|
|
||||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
|
||||||
);
|
|
||||||
#endif /* LWIP_HTTPD_CGI_SSI */
|
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI */
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_SSI
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Function pointer for the SSI tag handler callback.
|
|
||||||
*
|
|
||||||
* This function will be called each time the HTTPD server detects a tag of the
|
|
||||||
* form <!--#name--> in files with extensions mentioned in the g_pcSSIExtensions
|
|
||||||
* array (currently .shtml, .shtm, .ssi, .xml, .json) where "name" appears as
|
|
||||||
* one of the tags supplied to http_set_ssi_handler in the tags array. The
|
|
||||||
* returned insert string, which will be appended after the the string
|
|
||||||
* "<!--#name-->" in file sent back to the client, should be written to pointer
|
|
||||||
* pcInsert. iInsertLen contains the size of the buffer pointed to by
|
|
||||||
* pcInsert. The iIndex parameter provides the zero-based index of the tag as
|
|
||||||
* found in the tags array and identifies the tag that is to be processed.
|
|
||||||
*
|
|
||||||
* The handler returns the number of characters written to pcInsert excluding
|
|
||||||
* any terminating NULL or HTTPD_SSI_TAG_UNKNOWN when tag is not recognized.
|
|
||||||
*
|
|
||||||
* Note that the behavior of this SSI mechanism is somewhat different from the
|
|
||||||
* "normal" SSI processing as found in, for example, the Apache web server. In
|
|
||||||
* this case, the inserted text is appended following the SSI tag rather than
|
|
||||||
* replacing the tag entirely. This allows for an implementation that does not
|
|
||||||
* require significant additional buffering of output data yet which will still
|
|
||||||
* offer usable SSI functionality. One downside to this approach is when
|
|
||||||
* attempting to use SSI within JavaScript. The SSI tag is structured to
|
|
||||||
* resemble an HTML comment but this syntax does not constitute a comment
|
|
||||||
* within JavaScript and, hence, leaving the tag in place will result in
|
|
||||||
* problems in these cases. In order to avoid these problems, define
|
|
||||||
* LWIP_HTTPD_SSI_INCLUDE_TAG as zero in your lwip options file, or use JavaScript
|
|
||||||
* style block comments in the form / * # name * / (without the spaces).
|
|
||||||
*/
|
|
||||||
typedef u16_t (*tSSIHandler)(
|
|
||||||
#if LWIP_HTTPD_SSI_RAW
|
|
||||||
const char* ssi_tag_name,
|
|
||||||
#else /* LWIP_HTTPD_SSI_RAW */
|
|
||||||
int iIndex,
|
|
||||||
#endif /* LWIP_HTTPD_SSI_RAW */
|
|
||||||
char *pcInsert, int iInsertLen
|
|
||||||
#if LWIP_HTTPD_SSI_MULTIPART
|
|
||||||
, u16_t current_tag_part, u16_t *next_tag_part
|
|
||||||
#endif /* LWIP_HTTPD_SSI_MULTIPART */
|
|
||||||
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
|
|
||||||
, void *connection_state
|
|
||||||
#endif /* LWIP_HTTPD_FILE_STATE */
|
|
||||||
);
|
|
||||||
|
|
||||||
/** Set the SSI handler function
|
|
||||||
* (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used)
|
|
||||||
*/
|
|
||||||
void http_set_ssi_handler(tSSIHandler pfnSSIHandler,
|
|
||||||
const char **ppcTags, int iNumTags);
|
|
||||||
|
|
||||||
/** For LWIP_HTTPD_SSI_RAW==1, return this to indicate the tag is unknown.
|
|
||||||
* In this case, the webserver writes a warning into the page.
|
|
||||||
* You can also just return 0 to write nothing for unknown tags.
|
|
||||||
*/
|
|
||||||
#define HTTPD_SSI_TAG_UNKNOWN 0xFFFF
|
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_SSI */
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_SUPPORT_POST
|
|
||||||
|
|
||||||
/* These functions must be implemented by the application */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Called when a POST request has been received. The application can decide
|
|
||||||
* whether to accept it or not.
|
|
||||||
*
|
|
||||||
* @param connection Unique connection identifier, valid until httpd_post_end
|
|
||||||
* is called.
|
|
||||||
* @param uri The HTTP header URI receiving the POST request.
|
|
||||||
* @param http_request The raw HTTP request (the first packet, normally).
|
|
||||||
* @param http_request_len Size of 'http_request'.
|
|
||||||
* @param content_len Content-Length from HTTP header.
|
|
||||||
* @param response_uri Filename of response file, to be filled when denying the
|
|
||||||
* request
|
|
||||||
* @param response_uri_len Size of the 'response_uri' buffer.
|
|
||||||
* @param post_auto_wnd Set this to 0 to let the callback code handle window
|
|
||||||
* updates by calling 'httpd_post_data_recved' (to throttle rx speed)
|
|
||||||
* default is 1 (httpd handles window updates automatically)
|
|
||||||
* @return ERR_OK: Accept the POST request, data may be passed in
|
|
||||||
* another err_t: Deny the POST request, send back 'bad request'.
|
|
||||||
*/
|
|
||||||
err_t httpd_post_begin(void *connection, const char *uri, const char *http_request,
|
|
||||||
u16_t http_request_len, int content_len, char *response_uri,
|
|
||||||
u16_t response_uri_len, u8_t *post_auto_wnd);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Called for each pbuf of data that has been received for a POST.
|
|
||||||
* ATTENTION: The application is responsible for freeing the pbufs passed in!
|
|
||||||
*
|
|
||||||
* @param connection Unique connection identifier.
|
|
||||||
* @param p Received data.
|
|
||||||
* @return ERR_OK: Data accepted.
|
|
||||||
* another err_t: Data denied, http_post_get_response_uri will be called.
|
|
||||||
*/
|
|
||||||
err_t httpd_post_receive_data(void *connection, struct pbuf *p);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup httpd
|
|
||||||
* Called when all data is received or when the connection is closed.
|
|
||||||
* The application must return the filename/URI of a file to send in response
|
|
||||||
* to this POST request. If the response_uri buffer is untouched, a 404
|
|
||||||
* response is returned.
|
|
||||||
*
|
|
||||||
* @param connection Unique connection identifier.
|
|
||||||
* @param response_uri Filename of response file, to be filled when denying the request
|
|
||||||
* @param response_uri_len Size of the 'response_uri' buffer.
|
|
||||||
*/
|
|
||||||
void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len);
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_POST_MANUAL_WND
|
|
||||||
void httpd_post_data_recved(void *connection, u16_t recved_len);
|
|
||||||
#endif /* LWIP_HTTPD_POST_MANUAL_WND */
|
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_SUPPORT_POST */
|
|
||||||
|
|
||||||
void httpd_init(void);
|
|
||||||
|
|
||||||
#if HTTPD_ENABLE_HTTPS
|
|
||||||
struct altcp_tls_config;
|
|
||||||
void httpd_inits(struct altcp_tls_config *conf);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_HTTPD_H */
|
|
||||||
-396
@@ -1,396 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* HTTP server options list
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
* This version of the file has been modified by Texas Instruments to offer
|
|
||||||
* simple server-side-include (SSI) and Common Gateway Interface (CGI)
|
|
||||||
* capability.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_HTTPD_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_HTTPD_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup httpd_opts Options
|
|
||||||
* @ingroup httpd
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Set this to 1 to support CGI (old style).
|
|
||||||
*
|
|
||||||
* This old style CGI support works by registering an array of URLs and
|
|
||||||
* associated CGI handler functions (@ref http_set_cgi_handlers).
|
|
||||||
* This list is scanned just before fs_open is called from request handling.
|
|
||||||
* The handler can return a new URL that is used internally by the httpd to
|
|
||||||
* load the returned page (passed to fs_open).
|
|
||||||
*
|
|
||||||
* Use this CGI type e.g. to execute specific actions and return a page that
|
|
||||||
* does not depend on the CGI parameters.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_CGI || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_CGI 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support CGI (new style).
|
|
||||||
*
|
|
||||||
* This new style CGI support works by calling a global function
|
|
||||||
* (@ref tCGIHandler) for all URLs that are found. fs_open is called first
|
|
||||||
* and the URL can not be written by the CGI handler. Instead, this handler gets
|
|
||||||
* passed the http file state, an object where it can store information derived
|
|
||||||
* from the CGI URL or parameters. This file state is later passed to SSI, so
|
|
||||||
* the SSI code can return data depending on CGI input.
|
|
||||||
*
|
|
||||||
* Use this CGI handler if you want CGI information passed on to SSI.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_CGI_SSI || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_CGI_SSI 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support SSI (Server-Side-Includes)
|
|
||||||
*
|
|
||||||
* In contrast to other http servers, this only calls a preregistered callback
|
|
||||||
* function (@see http_set_ssi_handler) for each tag (in the format of
|
|
||||||
* <!--#tag-->) encountered in SSI-enabled pages.
|
|
||||||
* SSI-enabled pages must have one of the predefined SSI-enabled file extensions.
|
|
||||||
* All files with one of these extensions are parsed when sent.
|
|
||||||
*
|
|
||||||
* A downside of the current SSI implementation is that persistent connections
|
|
||||||
* don't work, as the file length is not known in advance (and httpd currently
|
|
||||||
* relies on the Content-Length header for persistent connections).
|
|
||||||
*
|
|
||||||
* To save memory, the maximum tag length is limited (@see LWIP_HTTPD_MAX_TAG_NAME_LEN).
|
|
||||||
* To save memory, the maximum insertion string length is limited (@see
|
|
||||||
* LWIP_HTTPD_MAX_TAG_INSERT_LEN). If this is not enough, @ref LWIP_HTTPD_SSI_MULTIPART
|
|
||||||
* can be used.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_SSI || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SSI 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to implement an SSI tag handler callback that gets a const char*
|
|
||||||
* to the tag (instead of an index into a pre-registered array of known tags)
|
|
||||||
* If this is 0, the SSI handler callback function is only called pre-registered tags.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_SSI_RAW || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SSI_RAW 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 0 to prevent parsing the file extension at runtime to decide
|
|
||||||
* if a file should be scanned for SSI tags or not.
|
|
||||||
* Default is 1 (file extensions are checked using the g_pcSSIExtensions array)
|
|
||||||
* Set to 2 to override this runtime test function.
|
|
||||||
*
|
|
||||||
* This is enabled by default, but if you only use a newer version of makefsdata
|
|
||||||
* supporting the "-ssi" option, this info is already present in
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_SSI_BY_FILE_EXTENSION || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support HTTP POST */
|
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SUPPORT_POST 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The maximum number of parameters that the CGI handler can be sent. */
|
|
||||||
#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more
|
|
||||||
* arguments indicating a counter for insert string that are too long to be
|
|
||||||
* inserted at once: the SSI handler function must then set 'next_tag_part'
|
|
||||||
* which will be passed back to it in the next call. */
|
|
||||||
#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SSI_MULTIPART 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The maximum length of the string comprising the SSI tag name
|
|
||||||
* ATTENTION: tags longer than this are ignored, not truncated!
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The maximum length of string that can be returned to replace any given tag
|
|
||||||
* If this buffer is not long enough, use LWIP_HTTPD_SSI_MULTIPART.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_POST_MANUAL_WND 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** This string is passed in the HTTP header as "Server: " */
|
|
||||||
#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__
|
|
||||||
#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 if you want to include code that creates HTTP headers
|
|
||||||
* at runtime. Default is off: HTTP headers are then created statically
|
|
||||||
* by the makefsdata tool. Static headers mean smaller code size, but
|
|
||||||
* the (readonly) fsdata will grow a bit as every file includes the HTTP
|
|
||||||
* header. */
|
|
||||||
#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_DYNAMIC_HEADERS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined HTTPD_DEBUG || defined __DOXYGEN__
|
|
||||||
#define HTTPD_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to use a memp pool for allocating
|
|
||||||
* struct http_state instead of the heap.
|
|
||||||
* If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS
|
|
||||||
* (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of
|
|
||||||
* the pool(s).
|
|
||||||
*/
|
|
||||||
#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__
|
|
||||||
#define HTTPD_USE_MEM_POOL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The server port for HTTPD to use */
|
|
||||||
#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__
|
|
||||||
#define HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The https server port for HTTPD to use */
|
|
||||||
#if !defined HTTPD_SERVER_PORT_HTTPS || defined __DOXYGEN__
|
|
||||||
#define HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Enable https support? */
|
|
||||||
#if !defined HTTPD_ENABLE_HTTPS || defined __DOXYGEN__
|
|
||||||
#define HTTPD_ENABLE_HTTPS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum retries before the connection is aborted/closed.
|
|
||||||
* - number of times pcb->poll is called -> default is 4*500ms = 2s;
|
|
||||||
* - reset when pcb->sent is called
|
|
||||||
*/
|
|
||||||
#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__
|
|
||||||
#define HTTPD_MAX_RETRIES 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The poll delay is X*500ms */
|
|
||||||
#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__
|
|
||||||
#define HTTPD_POLL_INTERVAL 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Priority for tcp pcbs created by HTTPD (very low by default).
|
|
||||||
* Lower priorities get killed first when running out of memory.
|
|
||||||
*/
|
|
||||||
#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__
|
|
||||||
#define HTTPD_TCP_PRIO TCP_PRIO_MIN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to enable timing each file sent */
|
|
||||||
#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_TIMING 0
|
|
||||||
#endif
|
|
||||||
/** Set this to 1 to enable timing each file sent */
|
|
||||||
#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__
|
|
||||||
#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to one to show error pages when parsing a request fails instead
|
|
||||||
of simply closing the connection. */
|
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes) */
|
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SUPPORT_V09 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to enable HTTP/1.1 persistent connections.
|
|
||||||
* ATTENTION: If the generated file system includes HTTP headers, these must
|
|
||||||
* include the "Connection: keep-alive" header (pass argument "-11" to makefsdata).
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support HTTP request coming in in multiple packets/pbufs */
|
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_HTTPD_SUPPORT_REQUESTLIST
|
|
||||||
/** Number of rx pbufs to enqueue to parse an incoming request (up to the first
|
|
||||||
newline) */
|
|
||||||
#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_REQ_QUEUELEN 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming
|
|
||||||
request (up to the first double-newline) */
|
|
||||||
#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Defines the maximum length of a HTTP request line (up to the first CRLF,
|
|
||||||
copied from pbuf into this a global buffer when pbuf- or packet-queues
|
|
||||||
are received - otherwise the input pbuf is used directly) */
|
|
||||||
#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))
|
|
||||||
#endif
|
|
||||||
#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */
|
|
||||||
|
|
||||||
/** This is the size of a static buffer used when URIs end with '/'.
|
|
||||||
* In this buffer, the directory requested is concatenated with all the
|
|
||||||
* configured default file names.
|
|
||||||
* Set to 0 to disable checking default filenames on non-root directories.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum length of the filename to send as response to a POST request,
|
|
||||||
* filled in by the application when a POST is finished.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 0 to not send the SSI tag (default is on, so the tag will
|
|
||||||
* be sent in the HTML page */
|
|
||||||
#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_SSI_INCLUDE_TAG 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to call tcp_abort when tcp_close fails with memory error.
|
|
||||||
* This can be used to prevent consuming all memory in situations where the
|
|
||||||
* HTTP server has low priority compared to other communication. */
|
|
||||||
#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to kill the oldest connection when running out of
|
|
||||||
* memory for 'struct http_state' or 'struct http_ssi_state'.
|
|
||||||
* ATTENTION: This puts all connections on a linked list, so may be kind of slow.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to send URIs without extension without headers
|
|
||||||
* (who uses this at all??) */
|
|
||||||
#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Default: Tags are sent from struct http_state and are therefore volatile */
|
|
||||||
#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__
|
|
||||||
#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low
|
|
||||||
when http is not an important protocol in the device. */
|
|
||||||
#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__
|
|
||||||
#define HTTPD_LIMIT_SENDING_TO_2MSS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define this to a function that returns the maximum amount of data to enqueue.
|
|
||||||
The function have this signature: u16_t fn(struct altcp_pcb* pcb);
|
|
||||||
The best place to define this is the hooks file (@see LWIP_HOOK_FILENAME) */
|
|
||||||
#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__
|
|
||||||
#if HTTPD_LIMIT_SENDING_TO_2MSS
|
|
||||||
#define HTTPD_MAX_WRITE_LEN(pcb) ((u16_t)(2 * altcp_mss(pcb)))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------- FS OPTIONS -------------------*/
|
|
||||||
|
|
||||||
/** Set this to 1 and provide the functions:
|
|
||||||
* - "int fs_open_custom(struct fs_file *file, const char *name)"
|
|
||||||
* Called first for every opened file to allow opening files
|
|
||||||
* that are not included in fsdata(_custom).c
|
|
||||||
* - "void fs_close_custom(struct fs_file *file)"
|
|
||||||
* Called to free resources allocated by fs_open_custom().
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_CUSTOM_FILES 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support fs_read() to dynamically read file data.
|
|
||||||
* Without this (default=off), only one-block files are supported,
|
|
||||||
* and the contents must be ready after fs_open().
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_DYNAMIC_FILE_READ 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to include an application state argument per file
|
|
||||||
* that is opened. This allows to keep a state per connection/file.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_FILE_STATE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for
|
|
||||||
* predefined (MSS-sized) chunks of the files to prevent having to calculate
|
|
||||||
* the checksums at runtime. */
|
|
||||||
#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__
|
|
||||||
#define HTTPD_PRECALCULATED_CHECKSUM 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations
|
|
||||||
* (fs_read_async returns FS_READ_DELAYED and calls a callback when finished).
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__
|
|
||||||
#define LWIP_HTTPD_FS_ASYNC_READ 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Filename (including path) to use as FS data file */
|
|
||||||
#if !defined HTTPD_FSDATA_FILE || defined __DOXYGEN__
|
|
||||||
/* HTTPD_USE_CUSTOM_FSDATA: Compatibility with deprecated lwIP option */
|
|
||||||
#if defined(HTTPD_USE_CUSTOM_FSDATA) && (HTTPD_USE_CUSTOM_FSDATA != 0)
|
|
||||||
#define HTTPD_FSDATA_FILE "fsdata_custom.c"
|
|
||||||
#else
|
|
||||||
#define HTTPD_FSDATA_FILE "fsdata.c"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */
|
|
||||||
-100
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP iPerf server implementation
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2014 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_LWIPERF_H
|
|
||||||
#define LWIP_HDR_APPS_LWIPERF_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LWIPERF_TCP_PORT_DEFAULT 5001
|
|
||||||
|
|
||||||
/** lwIPerf test results */
|
|
||||||
enum lwiperf_report_type
|
|
||||||
{
|
|
||||||
/** The server side test is done */
|
|
||||||
LWIPERF_TCP_DONE_SERVER,
|
|
||||||
/** The client side test is done */
|
|
||||||
LWIPERF_TCP_DONE_CLIENT,
|
|
||||||
/** Local error lead to test abort */
|
|
||||||
LWIPERF_TCP_ABORTED_LOCAL,
|
|
||||||
/** Data check error lead to test abort */
|
|
||||||
LWIPERF_TCP_ABORTED_LOCAL_DATAERROR,
|
|
||||||
/** Transmit error lead to test abort */
|
|
||||||
LWIPERF_TCP_ABORTED_LOCAL_TXERROR,
|
|
||||||
/** Remote side aborted the test */
|
|
||||||
LWIPERF_TCP_ABORTED_REMOTE
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Control */
|
|
||||||
enum lwiperf_client_type
|
|
||||||
{
|
|
||||||
/** Unidirectional tx only test */
|
|
||||||
LWIPERF_CLIENT,
|
|
||||||
/** Do a bidirectional test simultaneously */
|
|
||||||
LWIPERF_DUAL,
|
|
||||||
/** Do a bidirectional test individually */
|
|
||||||
LWIPERF_TRADEOFF
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Prototype of a report function that is called when a session is finished.
|
|
||||||
This report function can show the test results.
|
|
||||||
@param report_type contains the test result */
|
|
||||||
typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type,
|
|
||||||
const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port,
|
|
||||||
u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec);
|
|
||||||
|
|
||||||
void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port,
|
|
||||||
lwiperf_report_fn report_fn, void* report_arg);
|
|
||||||
void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg);
|
|
||||||
void* lwiperf_start_tcp_client(const ip_addr_t* remote_addr, u16_t remote_port,
|
|
||||||
enum lwiperf_client_type type,
|
|
||||||
lwiperf_report_fn report_fn, void* report_arg);
|
|
||||||
void* lwiperf_start_tcp_client_default(const ip_addr_t* remote_addr,
|
|
||||||
lwiperf_report_fn report_fn, void* report_arg);
|
|
||||||
|
|
||||||
void lwiperf_abort(void* lwiperf_session);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_LWIPERF_H */
|
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MDNS responder
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Verisure Innovation AB
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Ekman <erik@kryo.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_MDNS_H
|
|
||||||
#define LWIP_HDR_APPS_MDNS_H
|
|
||||||
|
|
||||||
#include "lwip/apps/mdns_opts.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_MDNS_RESPONDER
|
|
||||||
|
|
||||||
enum mdns_sd_proto {
|
|
||||||
DNSSD_PROTO_UDP = 0,
|
|
||||||
DNSSD_PROTO_TCP = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
#define MDNS_PROBING_CONFLICT 0
|
|
||||||
#define MDNS_PROBING_SUCCESSFUL 1
|
|
||||||
|
|
||||||
#define MDNS_LABEL_MAXLEN 63
|
|
||||||
|
|
||||||
struct mdns_host;
|
|
||||||
struct mdns_service;
|
|
||||||
|
|
||||||
/** Callback function to add text to a reply, called when generating the reply */
|
|
||||||
typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata);
|
|
||||||
|
|
||||||
/** Callback function to let application know the result of probing network for name
|
|
||||||
* uniqueness, called with result MDNS_PROBING_SUCCESSFUL if no other node claimed
|
|
||||||
* use for the name for the netif or a service and is safe to use, or MDNS_PROBING_CONFLICT
|
|
||||||
* if another node is already using it and mdns is disabled on this interface */
|
|
||||||
typedef void (*mdns_name_result_cb_t)(struct netif* netif, u8_t result);
|
|
||||||
|
|
||||||
void mdns_resp_init(void);
|
|
||||||
|
|
||||||
void mdns_resp_register_name_result_cb(mdns_name_result_cb_t cb);
|
|
||||||
|
|
||||||
err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl);
|
|
||||||
err_t mdns_resp_remove_netif(struct netif *netif);
|
|
||||||
err_t mdns_resp_rename_netif(struct netif *netif, const char *hostname);
|
|
||||||
|
|
||||||
s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
|
|
||||||
err_t mdns_resp_del_service(struct netif *netif, s8_t slot);
|
|
||||||
err_t mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name);
|
|
||||||
|
|
||||||
err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len);
|
|
||||||
|
|
||||||
void mdns_resp_restart(struct netif *netif);
|
|
||||||
void mdns_resp_announce(struct netif *netif);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mdns
|
|
||||||
* Announce IP settings have changed on netif.
|
|
||||||
* Call this in your callback registered by netif_set_status_callback().
|
|
||||||
* No need to call this function when LWIP_NETIF_EXT_STATUS_CALLBACK==1,
|
|
||||||
* this handled automatically for you.
|
|
||||||
* @param netif The network interface where settings have changed.
|
|
||||||
*/
|
|
||||||
#define mdns_resp_netif_settings_changed(netif) mdns_resp_announce(netif)
|
|
||||||
|
|
||||||
#endif /* LWIP_MDNS_RESPONDER */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MDNS_H */
|
|
||||||
-80
@@ -1,80 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MDNS responder
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Verisure Innovation AB
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Ekman <erik@kryo.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_MDNS_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_MDNS_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup mdns_opts Options
|
|
||||||
* @ingroup mdns
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS
|
|
||||||
* transport. IGMP is needed for IPv4 multicast.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_MDNS_RESPONDER
|
|
||||||
#define LWIP_MDNS_RESPONDER 0
|
|
||||||
#endif /* LWIP_MDNS_RESPONDER */
|
|
||||||
|
|
||||||
/** The maximum number of services per netif */
|
|
||||||
#ifndef MDNS_MAX_SERVICES
|
|
||||||
#define MDNS_MAX_SERVICES 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** MDNS_RESP_USENETIF_EXTCALLBACK==1: register an ext_callback on the netif
|
|
||||||
* to automatically restart probing/announcing on status or address change.
|
|
||||||
*/
|
|
||||||
#ifndef MDNS_RESP_USENETIF_EXTCALLBACK
|
|
||||||
#define MDNS_RESP_USENETIF_EXTCALLBACK LWIP_NETIF_EXT_STATUS_CALLBACK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MDNS_DEBUG: Enable debugging for multicast DNS.
|
|
||||||
*/
|
|
||||||
#ifndef MDNS_DEBUG
|
|
||||||
#define MDNS_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */
|
|
||||||
-74
@@ -1,74 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MDNS responder private definitions
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Verisure Innovation AB
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Ekman <erik@kryo.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_MDNS_PRIV_H
|
|
||||||
#define LWIP_HDR_MDNS_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/apps/mdns_opts.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_MDNS_RESPONDER
|
|
||||||
|
|
||||||
/* Domain struct and methods - visible for unit tests */
|
|
||||||
|
|
||||||
#define MDNS_DOMAIN_MAXLEN 256
|
|
||||||
#define MDNS_READNAME_ERROR 0xFFFF
|
|
||||||
|
|
||||||
struct mdns_domain {
|
|
||||||
/* Encoded domain name */
|
|
||||||
u8_t name[MDNS_DOMAIN_MAXLEN];
|
|
||||||
/* Total length of domain name, including zero */
|
|
||||||
u16_t length;
|
|
||||||
/* Set if compression of this domain is not allowed */
|
|
||||||
u8_t skip_compression;
|
|
||||||
};
|
|
||||||
|
|
||||||
err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len);
|
|
||||||
u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain);
|
|
||||||
int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b);
|
|
||||||
u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain);
|
|
||||||
|
|
||||||
#endif /* LWIP_MDNS_RESPONDER */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MDNS_PRIV_H */
|
|
||||||
-205
@@ -1,205 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MQTT client
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Erik Andersson
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Andersson
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_MQTT_CLIENT_H
|
|
||||||
#define LWIP_HDR_APPS_MQTT_CLIENT_H
|
|
||||||
|
|
||||||
#include "lwip/apps/mqtt_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct mqtt_client_s mqtt_client_t;
|
|
||||||
|
|
||||||
#if LWIP_ALTCP && LWIP_ALTCP_TLS
|
|
||||||
struct altcp_tls_config;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @ingroup mqtt
|
|
||||||
* Default MQTT port (non-TLS) */
|
|
||||||
#define MQTT_PORT LWIP_IANA_PORT_MQTT
|
|
||||||
/** @ingroup mqtt
|
|
||||||
* Default MQTT TLS port */
|
|
||||||
#define MQTT_TLS_PORT LWIP_IANA_PORT_SECURE_MQTT
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------------------- */
|
|
||||||
/* Connection with server */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Client information and connection parameters */
|
|
||||||
struct mqtt_connect_client_info_t {
|
|
||||||
/** Client identifier, must be set by caller */
|
|
||||||
const char *client_id;
|
|
||||||
/** User name, set to NULL if not used */
|
|
||||||
const char* client_user;
|
|
||||||
/** Password, set to NULL if not used */
|
|
||||||
const char* client_pass;
|
|
||||||
/** keep alive time in seconds, 0 to disable keep alive functionality*/
|
|
||||||
u16_t keep_alive;
|
|
||||||
/** will topic, set to NULL if will is not to be used,
|
|
||||||
will_msg, will_qos and will retain are then ignored */
|
|
||||||
const char* will_topic;
|
|
||||||
/** will_msg, see will_topic */
|
|
||||||
const char* will_msg;
|
|
||||||
/** will_qos, see will_topic */
|
|
||||||
u8_t will_qos;
|
|
||||||
/** will_retain, see will_topic */
|
|
||||||
u8_t will_retain;
|
|
||||||
#if LWIP_ALTCP && LWIP_ALTCP_TLS
|
|
||||||
/** TLS configuration for secure connections */
|
|
||||||
struct altcp_tls_config *tls_config;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Connection status codes */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
/** Accepted */
|
|
||||||
MQTT_CONNECT_ACCEPTED = 0,
|
|
||||||
/** Refused protocol version */
|
|
||||||
MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1,
|
|
||||||
/** Refused identifier */
|
|
||||||
MQTT_CONNECT_REFUSED_IDENTIFIER = 2,
|
|
||||||
/** Refused server */
|
|
||||||
MQTT_CONNECT_REFUSED_SERVER = 3,
|
|
||||||
/** Refused user credentials */
|
|
||||||
MQTT_CONNECT_REFUSED_USERNAME_PASS = 4,
|
|
||||||
/** Refused not authorized */
|
|
||||||
MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5,
|
|
||||||
/** Disconnected */
|
|
||||||
MQTT_CONNECT_DISCONNECTED = 256,
|
|
||||||
/** Timeout */
|
|
||||||
MQTT_CONNECT_TIMEOUT = 257
|
|
||||||
} mqtt_connection_status_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Function prototype for mqtt connection status callback. Called when
|
|
||||||
* client has connected to the server after initiating a mqtt connection attempt by
|
|
||||||
* calling mqtt_client_connect() or when connection is closed by server or an error
|
|
||||||
*
|
|
||||||
* @param client MQTT client itself
|
|
||||||
* @param arg Additional argument to pass to the callback function
|
|
||||||
* @param status Connect result code or disconnection notification @see mqtt_connection_status_t
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef void (*mqtt_connection_cb_t)(mqtt_client_t *client, void *arg, mqtt_connection_status_t status);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Data callback flags */
|
|
||||||
enum {
|
|
||||||
/** Flag set when last fragment of data arrives in data callback */
|
|
||||||
MQTT_DATA_FLAG_LAST = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Function prototype for MQTT incoming publish data callback function. Called when data
|
|
||||||
* arrives to a subscribed topic @see mqtt_subscribe
|
|
||||||
*
|
|
||||||
* @param arg Additional argument to pass to the callback function
|
|
||||||
* @param data User data, pointed object, data may not be referenced after callback return,
|
|
||||||
NULL is passed when all publish data are delivered
|
|
||||||
* @param len Length of publish data fragment
|
|
||||||
* @param flags MQTT_DATA_FLAG_LAST set when this call contains the last part of data from publish message
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Function prototype for MQTT incoming publish function. Called when an incoming publish
|
|
||||||
* arrives to a subscribed topic @see mqtt_subscribe
|
|
||||||
*
|
|
||||||
* @param arg Additional argument to pass to the callback function
|
|
||||||
* @param topic Zero terminated Topic text string, topic may not be referenced after callback return
|
|
||||||
* @param tot_len Total length of publish data, if set to 0 (no publish payload) data callback will not be invoked
|
|
||||||
*/
|
|
||||||
typedef void (*mqtt_incoming_publish_cb_t)(void *arg, const char *topic, u32_t tot_len);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mqtt
|
|
||||||
* Function prototype for mqtt request callback. Called when a subscribe, unsubscribe
|
|
||||||
* or publish request has completed
|
|
||||||
* @param arg Pointer to user data supplied when invoking request
|
|
||||||
* @param err ERR_OK on success
|
|
||||||
* ERR_TIMEOUT if no response was received within timeout,
|
|
||||||
* ERR_ABRT if (un)subscribe was denied
|
|
||||||
*/
|
|
||||||
typedef void (*mqtt_request_cb_t)(void *arg, err_t err);
|
|
||||||
|
|
||||||
|
|
||||||
err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg,
|
|
||||||
const struct mqtt_connect_client_info_t *client_info);
|
|
||||||
|
|
||||||
void mqtt_disconnect(mqtt_client_t *client);
|
|
||||||
|
|
||||||
mqtt_client_t *mqtt_client_new(void);
|
|
||||||
void mqtt_client_free(mqtt_client_t* client);
|
|
||||||
|
|
||||||
u8_t mqtt_client_is_connected(mqtt_client_t *client);
|
|
||||||
|
|
||||||
void mqtt_set_inpub_callback(mqtt_client_t *client, mqtt_incoming_publish_cb_t,
|
|
||||||
mqtt_incoming_data_cb_t data_cb, void *arg);
|
|
||||||
|
|
||||||
err_t mqtt_sub_unsub(mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub);
|
|
||||||
|
|
||||||
/** @ingroup mqtt
|
|
||||||
*Subscribe to topic */
|
|
||||||
#define mqtt_subscribe(client, topic, qos, cb, arg) mqtt_sub_unsub(client, topic, qos, cb, arg, 1)
|
|
||||||
/** @ingroup mqtt
|
|
||||||
* Unsubscribe to topic */
|
|
||||||
#define mqtt_unsubscribe(client, topic, cb, arg) mqtt_sub_unsub(client, topic, 0, cb, arg, 0)
|
|
||||||
|
|
||||||
err_t mqtt_publish(mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain,
|
|
||||||
mqtt_request_cb_t cb, void *arg);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MQTT_CLIENT_H */
|
|
||||||
-103
@@ -1,103 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MQTT client options
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Erik Andersson
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Andersson
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_MQTT_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_MQTT_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup mqtt_opts Options
|
|
||||||
* @ingroup mqtt
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_OUTPUT_RINGBUF_SIZE
|
|
||||||
#define MQTT_OUTPUT_RINGBUF_SIZE 256
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8
|
|
||||||
* If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_VAR_HEADER_BUFFER_LEN
|
|
||||||
#define MQTT_VAR_HEADER_BUFFER_LEN 128
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum number of pending subscribe, unsubscribe and publish requests to server .
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_REQ_MAX_IN_FLIGHT
|
|
||||||
#define MQTT_REQ_MAX_IN_FLIGHT 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seconds between each cyclic timer call.
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_CYCLIC_TIMER_INTERVAL
|
|
||||||
#define MQTT_CYCLIC_TIMER_INTERVAL 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Publish, subscribe and unsubscribe request timeout in seconds.
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_REQ_TIMEOUT
|
|
||||||
#define MQTT_REQ_TIMEOUT 30
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seconds for MQTT connect response timeout after sending connect request
|
|
||||||
*/
|
|
||||||
#ifndef MQTT_CONNECT_TIMOUT
|
|
||||||
#define MQTT_CONNECT_TIMOUT 100
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MQTT_OPTS_H */
|
|
||||||
-104
@@ -1,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* MQTT client (private interface)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Erik Andersson
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Erik Andersson
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_MQTT_PRIV_H
|
|
||||||
#define LWIP_HDR_APPS_MQTT_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/apps/mqtt.h"
|
|
||||||
#include "lwip/altcp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Pending request item, binds application callback to pending server requests */
|
|
||||||
struct mqtt_request_t
|
|
||||||
{
|
|
||||||
/** Next item in list, NULL means this is the last in chain,
|
|
||||||
next pointing at itself means request is unallocated */
|
|
||||||
struct mqtt_request_t *next;
|
|
||||||
/** Callback to upper layer */
|
|
||||||
mqtt_request_cb_t cb;
|
|
||||||
void *arg;
|
|
||||||
/** MQTT packet identifier */
|
|
||||||
u16_t pkt_id;
|
|
||||||
/** Expire time relative to element before this */
|
|
||||||
u16_t timeout_diff;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Ring buffer */
|
|
||||||
struct mqtt_ringbuf_t {
|
|
||||||
u16_t put;
|
|
||||||
u16_t get;
|
|
||||||
u8_t buf[MQTT_OUTPUT_RINGBUF_SIZE];
|
|
||||||
};
|
|
||||||
|
|
||||||
/** MQTT client */
|
|
||||||
struct mqtt_client_s
|
|
||||||
{
|
|
||||||
/** Timers and timeouts */
|
|
||||||
u16_t cyclic_tick;
|
|
||||||
u16_t keep_alive;
|
|
||||||
u16_t server_watchdog;
|
|
||||||
/** Packet identifier generator*/
|
|
||||||
u16_t pkt_id_seq;
|
|
||||||
/** Packet identifier of pending incoming publish */
|
|
||||||
u16_t inpub_pkt_id;
|
|
||||||
/** Connection state */
|
|
||||||
u8_t conn_state;
|
|
||||||
struct altcp_pcb *conn;
|
|
||||||
/** Connection callback */
|
|
||||||
void *connect_arg;
|
|
||||||
mqtt_connection_cb_t connect_cb;
|
|
||||||
/** Pending requests to server */
|
|
||||||
struct mqtt_request_t *pend_req_queue;
|
|
||||||
struct mqtt_request_t req_list[MQTT_REQ_MAX_IN_FLIGHT];
|
|
||||||
void *inpub_arg;
|
|
||||||
/** Incoming data callback */
|
|
||||||
mqtt_incoming_data_cb_t data_cb;
|
|
||||||
mqtt_incoming_publish_cb_t pub_cb;
|
|
||||||
/** Input */
|
|
||||||
u32_t msg_idx;
|
|
||||||
u8_t rx_buffer[MQTT_VAR_HEADER_BUFFER_LEN];
|
|
||||||
/** Output ring-buffer */
|
|
||||||
struct mqtt_ringbuf_t output;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MQTT_PRIV_H */
|
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* NETBIOS name service responder
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_NETBIOS_H
|
|
||||||
#define LWIP_HDR_APPS_NETBIOS_H
|
|
||||||
|
|
||||||
#include "lwip/apps/netbiosns_opts.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void netbiosns_init(void);
|
|
||||||
#ifndef NETBIOS_LWIP_NAME
|
|
||||||
void netbiosns_set_name(const char* hostname);
|
|
||||||
#endif
|
|
||||||
void netbiosns_stop(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_NETBIOS_H */
|
|
||||||
-66
@@ -1,66 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* NETBIOS name service responder options
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_NETBIOS_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_NETBIOS_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup netbiosns_opts Options
|
|
||||||
* @ingroup netbiosns
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** NetBIOS name of lwip device
|
|
||||||
* This must be uppercase until NETBIOS_STRCMP() is defined to a string
|
|
||||||
* comparison function that is case insensitive.
|
|
||||||
* If you want to use the netif's hostname, use this (with LWIP_NETIF_HOSTNAME):
|
|
||||||
* (ip_current_netif() != NULL ? ip_current_netif()->hostname != NULL ? ip_current_netif()->hostname : "" : "")
|
|
||||||
*
|
|
||||||
* If this is not defined, netbiosns_set_name() can be called at runtime to change the name.
|
|
||||||
*/
|
|
||||||
#ifdef __DOXYGEN__
|
|
||||||
#define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Respond to NetBIOS name queries
|
|
||||||
* Default is disabled
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_NETBIOS_RESPOND_NAME_QUERY || defined __DOXYGEN__
|
|
||||||
#define LWIP_NETBIOS_RESPOND_NAME_QUERY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_NETBIOS_OPTS_H */
|
|
||||||
-128
@@ -1,128 +0,0 @@
|
|||||||
#ifndef LWIP_HDR_APPS_SMTP_H
|
|
||||||
#define LWIP_HDR_APPS_SMTP_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "lwip/apps/smtp_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
|
|
||||||
/** The default TCP port used for SMTP */
|
|
||||||
#define SMTP_DEFAULT_PORT LWIP_IANA_PORT_SMTP
|
|
||||||
/** The default TCP port used for SMTPS */
|
|
||||||
#define SMTPS_DEFAULT_PORT LWIP_IANA_PORT_SMTPS
|
|
||||||
|
|
||||||
/** Email successfully sent */
|
|
||||||
#define SMTP_RESULT_OK 0
|
|
||||||
/** Unknown error */
|
|
||||||
#define SMTP_RESULT_ERR_UNKNOWN 1
|
|
||||||
/** Connection to server failed */
|
|
||||||
#define SMTP_RESULT_ERR_CONNECT 2
|
|
||||||
/** Failed to resolve server hostname */
|
|
||||||
#define SMTP_RESULT_ERR_HOSTNAME 3
|
|
||||||
/** Connection unexpectedly closed by remote server */
|
|
||||||
#define SMTP_RESULT_ERR_CLOSED 4
|
|
||||||
/** Connection timed out (server didn't respond in time) */
|
|
||||||
#define SMTP_RESULT_ERR_TIMEOUT 5
|
|
||||||
/** Server responded with an unknown response code */
|
|
||||||
#define SMTP_RESULT_ERR_SVR_RESP 6
|
|
||||||
/** Out of resources locally */
|
|
||||||
#define SMTP_RESULT_ERR_MEM 7
|
|
||||||
|
|
||||||
/** Prototype of an smtp callback function
|
|
||||||
*
|
|
||||||
* @param arg argument specified when initiating the email
|
|
||||||
* @param smtp_result result of the mail transfer (see defines SMTP_RESULT_*)
|
|
||||||
* @param srv_err if aborted by the server, this contains the error code received
|
|
||||||
* @param err an error returned by internal lwip functions, can help to specify
|
|
||||||
* the source of the error but must not necessarily be != ERR_OK
|
|
||||||
*/
|
|
||||||
typedef void (*smtp_result_fn)(void *arg, u8_t smtp_result, u16_t srv_err, err_t err);
|
|
||||||
|
|
||||||
/** This structure is used as argument for smtp_send_mail_int(),
|
|
||||||
* which in turn can be used with tcpip_callback() to send mail
|
|
||||||
* from interrupt context, e.g. like this:
|
|
||||||
* struct smtp_send_request *req; (to be filled)
|
|
||||||
* tcpip_try_callback(smtp_send_mail_int, (void*)req);
|
|
||||||
*
|
|
||||||
* For member description, see parameter description of smtp_send_mail().
|
|
||||||
* When using with tcpip_callback, this structure has to stay allocated
|
|
||||||
* (e.g. using mem_malloc/mem_free) until its 'callback_fn' is called.
|
|
||||||
*/
|
|
||||||
struct smtp_send_request {
|
|
||||||
const char *from;
|
|
||||||
const char* to;
|
|
||||||
const char* subject;
|
|
||||||
const char* body;
|
|
||||||
smtp_result_fn callback_fn;
|
|
||||||
void* callback_arg;
|
|
||||||
/** If this is != 0, data is *not* copied into an extra buffer
|
|
||||||
* but used from the pointers supplied in this struct.
|
|
||||||
* This means less memory usage, but data must stay untouched until
|
|
||||||
* the callback function is called. */
|
|
||||||
u8_t static_data;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#if SMTP_BODYDH
|
|
||||||
|
|
||||||
#ifndef SMTP_BODYDH_BUFFER_SIZE
|
|
||||||
#define SMTP_BODYDH_BUFFER_SIZE 256
|
|
||||||
#endif /* SMTP_BODYDH_BUFFER_SIZE */
|
|
||||||
|
|
||||||
struct smtp_bodydh {
|
|
||||||
u16_t state;
|
|
||||||
u16_t length; /* Length of content in buffer */
|
|
||||||
char buffer[SMTP_BODYDH_BUFFER_SIZE]; /* buffer for generated content */
|
|
||||||
#ifdef SMTP_BODYDH_USER_SIZE
|
|
||||||
u8_t user[SMTP_BODYDH_USER_SIZE];
|
|
||||||
#endif /* SMTP_BODYDH_USER_SIZE */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum bdh_retvals_e {
|
|
||||||
BDH_DONE = 0,
|
|
||||||
BDH_WORKING
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Prototype of an smtp body callback function
|
|
||||||
* It receives a struct smtp_bodydh, and a buffer to write data,
|
|
||||||
* must return BDH_WORKING to be called again and BDH_DONE when
|
|
||||||
* it has finished processing. This one tries to fill one TCP buffer with
|
|
||||||
* data, your function will be repeatedly called until that happens; so if you
|
|
||||||
* know you'll be taking too long to serve your request, pause once in a while
|
|
||||||
* by writing length=0 to avoid hogging system resources
|
|
||||||
*
|
|
||||||
* @param arg argument specified when initiating the email
|
|
||||||
* @param smtp_bodydh state handling + buffer structure
|
|
||||||
*/
|
|
||||||
typedef int (*smtp_bodycback_fn)(void *arg, struct smtp_bodydh *bodydh);
|
|
||||||
|
|
||||||
err_t smtp_send_mail_bodycback(const char *from, const char* to, const char* subject,
|
|
||||||
smtp_bodycback_fn bodycback_fn, smtp_result_fn callback_fn, void* callback_arg);
|
|
||||||
|
|
||||||
#endif /* SMTP_BODYDH */
|
|
||||||
|
|
||||||
|
|
||||||
err_t smtp_set_server_addr(const char* server);
|
|
||||||
void smtp_set_server_port(u16_t port);
|
|
||||||
#if LWIP_ALTCP && LWIP_ALTCP_TLS
|
|
||||||
struct altcp_tls_config;
|
|
||||||
void smtp_set_tls_config(struct altcp_tls_config *tls_config);
|
|
||||||
#endif
|
|
||||||
err_t smtp_set_auth(const char* username, const char* pass);
|
|
||||||
err_t smtp_send_mail(const char *from, const char* to, const char* subject, const char* body,
|
|
||||||
smtp_result_fn callback_fn, void* callback_arg);
|
|
||||||
err_t smtp_send_mail_static(const char *from, const char* to, const char* subject, const char* body,
|
|
||||||
smtp_result_fn callback_fn, void* callback_arg);
|
|
||||||
void smtp_send_mail_int(void *arg);
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
const char* smtp_result_str(u8_t smtp_result);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SMTP_H */
|
|
||||||
-80
@@ -1,80 +0,0 @@
|
|||||||
#ifndef LWIP_HDR_APPS_SMTP_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_SMTP_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup smtp_opts Options
|
|
||||||
* @ingroup smtp
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Set this to 1 to enable data handler callback on BODY */
|
|
||||||
#ifndef SMTP_BODYDH
|
|
||||||
#define SMTP_BODYDH 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** SMTP_DEBUG: Enable debugging for SNTP. */
|
|
||||||
#ifndef SMTP_DEBUG
|
|
||||||
#define SMTP_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum length reserved for server name including terminating 0 byte */
|
|
||||||
#ifndef SMTP_MAX_SERVERNAME_LEN
|
|
||||||
#define SMTP_MAX_SERVERNAME_LEN 256
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum length reserved for username */
|
|
||||||
#ifndef SMTP_MAX_USERNAME_LEN
|
|
||||||
#define SMTP_MAX_USERNAME_LEN 32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum length reserved for password */
|
|
||||||
#ifndef SMTP_MAX_PASS_LEN
|
|
||||||
#define SMTP_MAX_PASS_LEN 32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 0 if you know the authentication data will not change
|
|
||||||
* during the smtp session, which saves some heap space. */
|
|
||||||
#ifndef SMTP_COPY_AUTHDATA
|
|
||||||
#define SMTP_COPY_AUTHDATA 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 0 to save some code space if you know for sure that all data
|
|
||||||
* passed to this module conforms to the requirements in the SMTP RFC.
|
|
||||||
* WARNING: use this with care!
|
|
||||||
*/
|
|
||||||
#ifndef SMTP_CHECK_DATA
|
|
||||||
#define SMTP_CHECK_DATA 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to enable AUTH PLAIN support */
|
|
||||||
#ifndef SMTP_SUPPORT_AUTH_PLAIN
|
|
||||||
#define SMTP_SUPPORT_AUTH_PLAIN 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to enable AUTH LOGIN support */
|
|
||||||
#ifndef SMTP_SUPPORT_AUTH_LOGIN
|
|
||||||
#define SMTP_SUPPORT_AUTH_LOGIN 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Memory allocation/deallocation can be overridden... */
|
|
||||||
#ifndef SMTP_STATE_MALLOC
|
|
||||||
#define SMTP_STATE_MALLOC(size) mem_malloc(size)
|
|
||||||
#define SMTP_STATE_FREE(ptr) mem_free(ptr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SMTP_OPTS_H */
|
|
||||||
-135
@@ -1,135 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP server main API - start and basic configuration
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
|
|
||||||
* Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Leon Woestenberg <leon.woestenberg@axon.tv>
|
|
||||||
* Martin Hentschel <info@cl-soft.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
/** SNMP variable binding descriptor (publicly needed for traps) */
|
|
||||||
struct snmp_varbind
|
|
||||||
{
|
|
||||||
/** pointer to next varbind, NULL for last in list */
|
|
||||||
struct snmp_varbind *next;
|
|
||||||
/** pointer to previous varbind, NULL for first in list */
|
|
||||||
struct snmp_varbind *prev;
|
|
||||||
|
|
||||||
/** object identifier */
|
|
||||||
struct snmp_obj_id oid;
|
|
||||||
|
|
||||||
/** value ASN1 type */
|
|
||||||
u8_t type;
|
|
||||||
/** object value length */
|
|
||||||
u16_t value_len;
|
|
||||||
/** object value */
|
|
||||||
void *value;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup snmp_core
|
|
||||||
* Agent setup, start listening to port 161.
|
|
||||||
*/
|
|
||||||
void snmp_init(void);
|
|
||||||
void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs);
|
|
||||||
|
|
||||||
void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid);
|
|
||||||
const struct snmp_obj_id* snmp_get_device_enterprise_oid(void);
|
|
||||||
|
|
||||||
void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);
|
|
||||||
void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst);
|
|
||||||
|
|
||||||
/** Generic trap: cold start */
|
|
||||||
#define SNMP_GENTRAP_COLDSTART 0
|
|
||||||
/** Generic trap: warm start */
|
|
||||||
#define SNMP_GENTRAP_WARMSTART 1
|
|
||||||
/** Generic trap: link down */
|
|
||||||
#define SNMP_GENTRAP_LINKDOWN 2
|
|
||||||
/** Generic trap: link up */
|
|
||||||
#define SNMP_GENTRAP_LINKUP 3
|
|
||||||
/** Generic trap: authentication failure */
|
|
||||||
#define SNMP_GENTRAP_AUTH_FAILURE 4
|
|
||||||
/** Generic trap: EGP neighbor lost */
|
|
||||||
#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5
|
|
||||||
/** Generic trap: enterprise specific */
|
|
||||||
#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6
|
|
||||||
|
|
||||||
err_t snmp_send_trap_generic(s32_t generic_trap);
|
|
||||||
err_t snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds);
|
|
||||||
err_t snmp_send_trap(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds);
|
|
||||||
|
|
||||||
#define SNMP_AUTH_TRAPS_DISABLED 0
|
|
||||||
#define SNMP_AUTH_TRAPS_ENABLED 1
|
|
||||||
void snmp_set_auth_traps_enabled(u8_t enable);
|
|
||||||
u8_t snmp_get_auth_traps_enabled(void);
|
|
||||||
|
|
||||||
u8_t snmp_v1_enabled(void);
|
|
||||||
u8_t snmp_v2c_enabled(void);
|
|
||||||
u8_t snmp_v3_enabled(void);
|
|
||||||
void snmp_v1_enable(u8_t enable);
|
|
||||||
void snmp_v2c_enable(u8_t enable);
|
|
||||||
void snmp_v3_enable(u8_t enable);
|
|
||||||
|
|
||||||
const char * snmp_get_community(void);
|
|
||||||
const char * snmp_get_community_write(void);
|
|
||||||
const char * snmp_get_community_trap(void);
|
|
||||||
void snmp_set_community(const char * const community);
|
|
||||||
void snmp_set_community_write(const char * const community);
|
|
||||||
void snmp_set_community_trap(const char * const community);
|
|
||||||
|
|
||||||
void snmp_coldstart_trap(void);
|
|
||||||
void snmp_authfail_trap(void);
|
|
||||||
|
|
||||||
typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg);
|
|
||||||
void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg);
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_H */
|
|
||||||
-377
@@ -1,377 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP core API for implementing MIBs
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* Author: Christiaan Simons <christiaan.simons@axon.tv>
|
|
||||||
* Martin Hentschel <info@cl-soft.de>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_CORE_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_CORE_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* basic ASN1 defines */
|
|
||||||
#define SNMP_ASN1_CLASS_UNIVERSAL 0x00
|
|
||||||
#define SNMP_ASN1_CLASS_APPLICATION 0x40
|
|
||||||
#define SNMP_ASN1_CLASS_CONTEXT 0x80
|
|
||||||
#define SNMP_ASN1_CLASS_PRIVATE 0xC0
|
|
||||||
|
|
||||||
#define SNMP_ASN1_CONTENTTYPE_PRIMITIVE 0x00
|
|
||||||
#define SNMP_ASN1_CONTENTTYPE_CONSTRUCTED 0x20
|
|
||||||
|
|
||||||
/* universal tags (from ASN.1 spec.) */
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_END_OF_CONTENT 0
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_INTEGER 2
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_OCTET_STRING 4
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_NULL 5
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_OBJECT_ID 6
|
|
||||||
#define SNMP_ASN1_UNIVERSAL_SEQUENCE_OF 16
|
|
||||||
|
|
||||||
/* application specific (SNMP) tags (from SNMPv2-SMI) */
|
|
||||||
#define SNMP_ASN1_APPLICATION_IPADDR 0 /* [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4)) */
|
|
||||||
#define SNMP_ASN1_APPLICATION_COUNTER 1 /* [APPLICATION 1] IMPLICIT INTEGER (0..4294967295) => u32_t */
|
|
||||||
#define SNMP_ASN1_APPLICATION_GAUGE 2 /* [APPLICATION 2] IMPLICIT INTEGER (0..4294967295) => u32_t */
|
|
||||||
#define SNMP_ASN1_APPLICATION_TIMETICKS 3 /* [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) => u32_t */
|
|
||||||
#define SNMP_ASN1_APPLICATION_OPAQUE 4 /* [APPLICATION 4] IMPLICIT OCTET STRING */
|
|
||||||
#define SNMP_ASN1_APPLICATION_COUNTER64 6 /* [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615) */
|
|
||||||
|
|
||||||
/* context specific (SNMP) tags (from RFC 1905) */
|
|
||||||
#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE 1
|
|
||||||
|
|
||||||
/* full ASN1 type defines */
|
|
||||||
#define SNMP_ASN1_TYPE_END_OF_CONTENT (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_END_OF_CONTENT)
|
|
||||||
#define SNMP_ASN1_TYPE_INTEGER (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_INTEGER)
|
|
||||||
#define SNMP_ASN1_TYPE_OCTET_STRING (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OCTET_STRING)
|
|
||||||
#define SNMP_ASN1_TYPE_NULL (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_NULL)
|
|
||||||
#define SNMP_ASN1_TYPE_OBJECT_ID (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OBJECT_ID)
|
|
||||||
#define SNMP_ASN1_TYPE_SEQUENCE (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_UNIVERSAL_SEQUENCE_OF)
|
|
||||||
#define SNMP_ASN1_TYPE_IPADDR (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_IPADDR)
|
|
||||||
#define SNMP_ASN1_TYPE_IPADDRESS SNMP_ASN1_TYPE_IPADDR
|
|
||||||
#define SNMP_ASN1_TYPE_COUNTER (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER)
|
|
||||||
#define SNMP_ASN1_TYPE_COUNTER32 SNMP_ASN1_TYPE_COUNTER
|
|
||||||
#define SNMP_ASN1_TYPE_GAUGE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_GAUGE)
|
|
||||||
#define SNMP_ASN1_TYPE_GAUGE32 SNMP_ASN1_TYPE_GAUGE
|
|
||||||
#define SNMP_ASN1_TYPE_UNSIGNED32 SNMP_ASN1_TYPE_GAUGE
|
|
||||||
#define SNMP_ASN1_TYPE_TIMETICKS (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_TIMETICKS)
|
|
||||||
#define SNMP_ASN1_TYPE_OPAQUE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_OPAQUE)
|
|
||||||
#if LWIP_HAVE_INT64
|
|
||||||
#define SNMP_ASN1_TYPE_COUNTER64 (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER64)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SNMP_VARBIND_EXCEPTION_OFFSET 0xF0
|
|
||||||
#define SNMP_VARBIND_EXCEPTION_MASK 0x0F
|
|
||||||
|
|
||||||
/** error codes predefined by SNMP prot. */
|
|
||||||
typedef enum {
|
|
||||||
SNMP_ERR_NOERROR = 0,
|
|
||||||
/*
|
|
||||||
outdated v1 error codes. do not use anmore!
|
|
||||||
#define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead
|
|
||||||
#define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead
|
|
||||||
#define SNMP_ERR_READONLY 4 use SNMP_ERR_NOTWRITABLE instead
|
|
||||||
*/
|
|
||||||
SNMP_ERR_GENERROR = 5,
|
|
||||||
SNMP_ERR_NOACCESS = 6,
|
|
||||||
SNMP_ERR_WRONGTYPE = 7,
|
|
||||||
SNMP_ERR_WRONGLENGTH = 8,
|
|
||||||
SNMP_ERR_WRONGENCODING = 9,
|
|
||||||
SNMP_ERR_WRONGVALUE = 10,
|
|
||||||
SNMP_ERR_NOCREATION = 11,
|
|
||||||
SNMP_ERR_INCONSISTENTVALUE = 12,
|
|
||||||
SNMP_ERR_RESOURCEUNAVAILABLE = 13,
|
|
||||||
SNMP_ERR_COMMITFAILED = 14,
|
|
||||||
SNMP_ERR_UNDOFAILED = 15,
|
|
||||||
SNMP_ERR_NOTWRITABLE = 17,
|
|
||||||
SNMP_ERR_INCONSISTENTNAME = 18,
|
|
||||||
|
|
||||||
SNMP_ERR_NOSUCHINSTANCE = SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE
|
|
||||||
} snmp_err_t;
|
|
||||||
|
|
||||||
/** internal object identifier representation */
|
|
||||||
struct snmp_obj_id
|
|
||||||
{
|
|
||||||
u8_t len;
|
|
||||||
u32_t id[SNMP_MAX_OBJ_ID_LEN];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct snmp_obj_id_const_ref
|
|
||||||
{
|
|
||||||
u8_t len;
|
|
||||||
const u32_t* id;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const struct snmp_obj_id_const_ref snmp_zero_dot_zero; /* administrative identifier from SNMPv2-SMI */
|
|
||||||
|
|
||||||
/** SNMP variant value, used as reference in struct snmp_node_instance and table implementation */
|
|
||||||
union snmp_variant_value
|
|
||||||
{
|
|
||||||
void* ptr;
|
|
||||||
const void* const_ptr;
|
|
||||||
u32_t u32;
|
|
||||||
s32_t s32;
|
|
||||||
#if LWIP_HAVE_INT64
|
|
||||||
u64_t u64;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
SNMP MIB node types
|
|
||||||
tree node is the only node the stack can process in order to walk the tree,
|
|
||||||
all other nodes are assumed to be leaf nodes.
|
|
||||||
This cannot be an enum because users may want to define their own node types.
|
|
||||||
*/
|
|
||||||
#define SNMP_NODE_TREE 0x00
|
|
||||||
/* predefined leaf node types */
|
|
||||||
#define SNMP_NODE_SCALAR 0x01
|
|
||||||
#define SNMP_NODE_SCALAR_ARRAY 0x02
|
|
||||||
#define SNMP_NODE_TABLE 0x03
|
|
||||||
#define SNMP_NODE_THREADSYNC 0x04
|
|
||||||
|
|
||||||
/** node "base class" layout, the mandatory fields for a node */
|
|
||||||
struct snmp_node
|
|
||||||
{
|
|
||||||
/** one out of SNMP_NODE_TREE or any leaf node type (like SNMP_NODE_SCALAR) */
|
|
||||||
u8_t node_type;
|
|
||||||
/** the number assigned to this node which used as part of the full OID */
|
|
||||||
u32_t oid;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** SNMP node instance access types */
|
|
||||||
typedef enum {
|
|
||||||
SNMP_NODE_INSTANCE_ACCESS_READ = 1,
|
|
||||||
SNMP_NODE_INSTANCE_ACCESS_WRITE = 2,
|
|
||||||
SNMP_NODE_INSTANCE_READ_ONLY = SNMP_NODE_INSTANCE_ACCESS_READ,
|
|
||||||
SNMP_NODE_INSTANCE_READ_WRITE = (SNMP_NODE_INSTANCE_ACCESS_READ | SNMP_NODE_INSTANCE_ACCESS_WRITE),
|
|
||||||
SNMP_NODE_INSTANCE_WRITE_ONLY = SNMP_NODE_INSTANCE_ACCESS_WRITE,
|
|
||||||
SNMP_NODE_INSTANCE_NOT_ACCESSIBLE = 0
|
|
||||||
} snmp_access_t;
|
|
||||||
|
|
||||||
struct snmp_node_instance;
|
|
||||||
|
|
||||||
typedef s16_t (*node_instance_get_value_method)(struct snmp_node_instance*, void*);
|
|
||||||
typedef snmp_err_t (*node_instance_set_test_method)(struct snmp_node_instance*, u16_t, void*);
|
|
||||||
typedef snmp_err_t (*node_instance_set_value_method)(struct snmp_node_instance*, u16_t, void*);
|
|
||||||
typedef void (*node_instance_release_method)(struct snmp_node_instance*);
|
|
||||||
|
|
||||||
#define SNMP_GET_VALUE_RAW_DATA 0x4000 /* do not use 0x8000 because return value of node_instance_get_value_method is signed16 and 0x8000 would be the signed bit */
|
|
||||||
|
|
||||||
/** SNMP node instance */
|
|
||||||
struct snmp_node_instance
|
|
||||||
{
|
|
||||||
/** prefilled with the node, get_instance() is called on; may be changed by user to any value to pass an arbitrary node between calls to get_instance() and get_value/test_value/set_value */
|
|
||||||
const struct snmp_node* node;
|
|
||||||
/** prefilled with the instance id requested; for get_instance() this is the exact oid requested; for get_next_instance() this is the relative starting point, stack expects relative oid of next node here */
|
|
||||||
struct snmp_obj_id instance_oid;
|
|
||||||
|
|
||||||
/** ASN type for this object (see snmp_asn1.h for definitions) */
|
|
||||||
u8_t asn1_type;
|
|
||||||
/** one out of instance access types defined above (SNMP_NODE_INSTANCE_READ_ONLY,...) */
|
|
||||||
snmp_access_t access;
|
|
||||||
|
|
||||||
/** returns object value for the given object identifier. Return values <0 to indicate an error */
|
|
||||||
node_instance_get_value_method get_value;
|
|
||||||
/** tests length and/or range BEFORE setting */
|
|
||||||
node_instance_set_test_method set_test;
|
|
||||||
/** sets object value, only called when set_test() was successful */
|
|
||||||
node_instance_set_value_method set_value;
|
|
||||||
/** called in any case when the instance is not required anymore by stack (useful for freeing memory allocated in get_instance/get_next_instance methods) */
|
|
||||||
node_instance_release_method release_instance;
|
|
||||||
|
|
||||||
/** reference to pass arbitrary value between calls to get_instance() and get_value/test_value/set_value */
|
|
||||||
union snmp_variant_value reference;
|
|
||||||
/** see reference (if reference is a pointer, the length of underlying data may be stored here or anything else) */
|
|
||||||
u32_t reference_len;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/** SNMP tree node */
|
|
||||||
struct snmp_tree_node
|
|
||||||
{
|
|
||||||
/** inherited "base class" members */
|
|
||||||
struct snmp_node node;
|
|
||||||
u16_t subnode_count;
|
|
||||||
const struct snmp_node* const *subnodes;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SNMP_CREATE_TREE_NODE(oid, subnodes) \
|
|
||||||
{{ SNMP_NODE_TREE, (oid) }, \
|
|
||||||
(u16_t)LWIP_ARRAYSIZE(subnodes), (subnodes) }
|
|
||||||
|
|
||||||
#define SNMP_CREATE_EMPTY_TREE_NODE(oid) \
|
|
||||||
{{ SNMP_NODE_TREE, (oid) }, \
|
|
||||||
0, NULL }
|
|
||||||
|
|
||||||
/** SNMP leaf node */
|
|
||||||
struct snmp_leaf_node
|
|
||||||
{
|
|
||||||
/** inherited "base class" members */
|
|
||||||
struct snmp_node node;
|
|
||||||
snmp_err_t (*get_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t (*get_next_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** represents a single mib with its base oid and root node */
|
|
||||||
struct snmp_mib
|
|
||||||
{
|
|
||||||
const u32_t *base_oid;
|
|
||||||
u8_t base_oid_len;
|
|
||||||
const struct snmp_node *root_node;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SNMP_MIB_CREATE(oid_list, root_node) { (oid_list), (u8_t)LWIP_ARRAYSIZE(oid_list), root_node }
|
|
||||||
|
|
||||||
/** OID range structure */
|
|
||||||
struct snmp_oid_range
|
|
||||||
{
|
|
||||||
u32_t min;
|
|
||||||
u32_t max;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** checks if incoming OID length and values are in allowed ranges */
|
|
||||||
u8_t snmp_oid_in_range(const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len);
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
SNMP_NEXT_OID_STATUS_SUCCESS,
|
|
||||||
SNMP_NEXT_OID_STATUS_NO_MATCH,
|
|
||||||
SNMP_NEXT_OID_STATUS_BUF_TO_SMALL
|
|
||||||
} snmp_next_oid_status_t;
|
|
||||||
|
|
||||||
/** state for next_oid_init / next_oid_check functions */
|
|
||||||
struct snmp_next_oid_state
|
|
||||||
{
|
|
||||||
const u32_t* start_oid;
|
|
||||||
u8_t start_oid_len;
|
|
||||||
|
|
||||||
u32_t* next_oid;
|
|
||||||
u8_t next_oid_len;
|
|
||||||
u8_t next_oid_max_len;
|
|
||||||
|
|
||||||
snmp_next_oid_status_t status;
|
|
||||||
void* reference;
|
|
||||||
};
|
|
||||||
|
|
||||||
void snmp_next_oid_init(struct snmp_next_oid_state *state,
|
|
||||||
const u32_t *start_oid, u8_t start_oid_len,
|
|
||||||
u32_t *next_oid_buf, u8_t next_oid_max_len);
|
|
||||||
u8_t snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len);
|
|
||||||
u8_t snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len, void* reference);
|
|
||||||
|
|
||||||
void snmp_oid_assign(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);
|
|
||||||
void snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);
|
|
||||||
void snmp_oid_prefix(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);
|
|
||||||
void snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);
|
|
||||||
u8_t snmp_oid_equal(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);
|
|
||||||
s8_t snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
u8_t snmp_oid_to_ip4(const u32_t *oid, ip4_addr_t *ip);
|
|
||||||
void snmp_ip4_to_oid(const ip4_addr_t *ip, u32_t *oid);
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#if LWIP_IPV6
|
|
||||||
u8_t snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip);
|
|
||||||
void snmp_ip6_to_oid(const ip6_addr_t *ip, u32_t *oid);
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
#if LWIP_IPV4 || LWIP_IPV6
|
|
||||||
u8_t snmp_ip_to_oid(const ip_addr_t *ip, u32_t *oid);
|
|
||||||
u8_t snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid);
|
|
||||||
|
|
||||||
u8_t snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip);
|
|
||||||
u8_t snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port);
|
|
||||||
#endif /* LWIP_IPV4 || LWIP_IPV6 */
|
|
||||||
|
|
||||||
struct netif;
|
|
||||||
u8_t netif_to_num(const struct netif *netif);
|
|
||||||
|
|
||||||
snmp_err_t snmp_set_test_ok(struct snmp_node_instance* instance, u16_t value_len, void* value); /* generic function which can be used if test is always successful */
|
|
||||||
|
|
||||||
err_t snmp_decode_bits(const u8_t *buf, u32_t buf_len, u32_t *bit_value);
|
|
||||||
err_t snmp_decode_truthvalue(const s32_t *asn1_value, u8_t *bool_value);
|
|
||||||
u8_t snmp_encode_bits(u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count);
|
|
||||||
u8_t snmp_encode_truthvalue(s32_t *asn1_value, u32_t bool_value);
|
|
||||||
|
|
||||||
struct snmp_statistics
|
|
||||||
{
|
|
||||||
u32_t inpkts;
|
|
||||||
u32_t outpkts;
|
|
||||||
u32_t inbadversions;
|
|
||||||
u32_t inbadcommunitynames;
|
|
||||||
u32_t inbadcommunityuses;
|
|
||||||
u32_t inasnparseerrs;
|
|
||||||
u32_t intoobigs;
|
|
||||||
u32_t innosuchnames;
|
|
||||||
u32_t inbadvalues;
|
|
||||||
u32_t inreadonlys;
|
|
||||||
u32_t ingenerrs;
|
|
||||||
u32_t intotalreqvars;
|
|
||||||
u32_t intotalsetvars;
|
|
||||||
u32_t ingetrequests;
|
|
||||||
u32_t ingetnexts;
|
|
||||||
u32_t insetrequests;
|
|
||||||
u32_t ingetresponses;
|
|
||||||
u32_t intraps;
|
|
||||||
u32_t outtoobigs;
|
|
||||||
u32_t outnosuchnames;
|
|
||||||
u32_t outbadvalues;
|
|
||||||
u32_t outgenerrs;
|
|
||||||
u32_t outgetrequests;
|
|
||||||
u32_t outgetnexts;
|
|
||||||
u32_t outsetrequests;
|
|
||||||
u32_t outgetresponses;
|
|
||||||
u32_t outtraps;
|
|
||||||
#if LWIP_SNMP_V3
|
|
||||||
u32_t unsupportedseclevels;
|
|
||||||
u32_t notintimewindows;
|
|
||||||
u32_t unknownusernames;
|
|
||||||
u32_t unknownengineids;
|
|
||||||
u32_t wrongdigests;
|
|
||||||
u32_t decryptionerrors;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct snmp_statistics snmp_stats;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_CORE_H */
|
|
||||||
-78
@@ -1,78 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP MIB2 API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Dirk Ziegelmeier <dziegel@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_MIB2_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_MIB2_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
#if SNMP_LWIP_MIB2
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
extern const struct snmp_mib mib2;
|
|
||||||
|
|
||||||
#if SNMP_USE_NETCONN
|
|
||||||
#include "lwip/apps/snmp_threadsync.h"
|
|
||||||
void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg);
|
|
||||||
extern struct snmp_threadsync_instance snmp_mib2_lwip_locks;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SNMP_SYSSERVICES
|
|
||||||
#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len); /* read-only be definition */
|
|
||||||
void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
|
|
||||||
void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
|
|
||||||
void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
|
|
||||||
void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
|
|
||||||
void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
|
|
||||||
void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
|
|
||||||
|
|
||||||
#endif /* SNMP_LWIP_MIB2 */
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_MIB2_H */
|
|
||||||
-297
@@ -1,297 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP server options list
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Dirk Ziegelmeier
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Dirk Ziegelmeier
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_SNMP_OPTS_H
|
|
||||||
#define LWIP_HDR_SNMP_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup snmp_opts Options
|
|
||||||
* @ingroup snmp
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* LWIP_SNMP==1: This enables the lwIP SNMP agent. UDP must be available
|
|
||||||
* for SNMP transport.
|
|
||||||
* If you want to use your own SNMP agent, leave this disabled.
|
|
||||||
* To integrate MIB2 of an external agent, you need to enable
|
|
||||||
* LWIP_MIB2_CALLBACKS and MIB2_STATS. This will give you the callbacks
|
|
||||||
* and statistics counters you need to get MIB2 working.
|
|
||||||
*/
|
|
||||||
#if !defined LWIP_SNMP || defined __DOXYGEN__
|
|
||||||
#define LWIP_SNMP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_USE_NETCONN: Use netconn API instead of raw API.
|
|
||||||
* Makes SNMP agent run in a worker thread, so blocking operations
|
|
||||||
* can be done in MIB calls.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_USE_NETCONN || defined __DOXYGEN__
|
|
||||||
#define SNMP_USE_NETCONN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_USE_RAW: Use raw API.
|
|
||||||
* SNMP agent does not run in a worker thread, so blocking operations
|
|
||||||
* should not be done in MIB calls.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_USE_RAW || defined __DOXYGEN__
|
|
||||||
#define SNMP_USE_RAW 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SNMP_USE_NETCONN && SNMP_USE_RAW
|
|
||||||
#error SNMP stack can use only one of the APIs {raw, netconn}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP && !SNMP_USE_NETCONN && !SNMP_USE_RAW
|
|
||||||
#error SNMP stack needs a receive API and UDP {raw, netconn}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SNMP_USE_NETCONN
|
|
||||||
/**
|
|
||||||
* SNMP_STACK_SIZE: Stack size of SNMP netconn worker thread
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_STACK_SIZE || defined __DOXYGEN__
|
|
||||||
#define SNMP_STACK_SIZE DEFAULT_THREAD_STACKSIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_THREAD_PRIO: SNMP netconn worker thread priority
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_THREAD_PRIO || defined __DOXYGEN__
|
|
||||||
#define SNMP_THREAD_PRIO DEFAULT_THREAD_PRIO
|
|
||||||
#endif
|
|
||||||
#endif /* SNMP_USE_NETCONN */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
|
|
||||||
* destination is required
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_TRAP_DESTINATIONS || defined __DOXYGEN__
|
|
||||||
#define SNMP_TRAP_DESTINATIONS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only allow SNMP write actions that are 'safe' (e.g. disabling netifs is not
|
|
||||||
* a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
|
|
||||||
* Unsafe requests are disabled by default!
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_SAFE_REQUESTS || defined __DOXYGEN__
|
|
||||||
#define SNMP_SAFE_REQUESTS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum length of strings used.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_MAX_OCTET_STRING_LEN || defined __DOXYGEN__
|
|
||||||
#define SNMP_MAX_OCTET_STRING_LEN 127
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum number of Sub ID's inside an object identifier.
|
|
||||||
* Indirectly this also limits the maximum depth of SNMP tree.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_MAX_OBJ_ID_LEN || defined __DOXYGEN__
|
|
||||||
#define SNMP_MAX_OBJ_ID_LEN 50
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined SNMP_MAX_VALUE_SIZE || defined __DOXYGEN__
|
|
||||||
/**
|
|
||||||
* The minimum size of a value.
|
|
||||||
*/
|
|
||||||
#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */
|
|
||||||
/**
|
|
||||||
* The maximum size of a value.
|
|
||||||
*/
|
|
||||||
#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The snmp read-access community. Used for write-access and traps, too
|
|
||||||
* unless SNMP_COMMUNITY_WRITE or SNMP_COMMUNITY_TRAP are enabled, respectively.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_COMMUNITY || defined __DOXYGEN__
|
|
||||||
#define SNMP_COMMUNITY "public"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The snmp write-access community.
|
|
||||||
* Set this community to "" in order to disallow any write access.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_COMMUNITY_WRITE || defined __DOXYGEN__
|
|
||||||
#define SNMP_COMMUNITY_WRITE "private"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The snmp community used for sending traps.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_COMMUNITY_TRAP || defined __DOXYGEN__
|
|
||||||
#define SNMP_COMMUNITY_TRAP "public"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum length of community string.
|
|
||||||
* If community names shall be adjusted at runtime via snmp_set_community() calls,
|
|
||||||
* enter here the possible maximum length (+1 for terminating null character).
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_MAX_COMMUNITY_STR_LEN || defined __DOXYGEN__
|
|
||||||
#define SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The OID identifiying the device. This may be the enterprise OID itself or any OID located below it in tree.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_DEVICE_ENTERPRISE_OID || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_ENTERPRISE_OID 26381
|
|
||||||
/**
|
|
||||||
* IANA assigned enterprise ID for lwIP is 26381
|
|
||||||
* @see http://www.iana.org/assignments/enterprise-numbers
|
|
||||||
*
|
|
||||||
* @note this enterprise ID is assigned to the lwIP project,
|
|
||||||
* all object identifiers living under this ID are assigned
|
|
||||||
* by the lwIP maintainers!
|
|
||||||
* @note don't change this define, use snmp_set_device_enterprise_oid()
|
|
||||||
*
|
|
||||||
* If you need to create your own private MIB you'll need
|
|
||||||
* to apply for your own enterprise ID with IANA:
|
|
||||||
* http://www.iana.org/numbers.html
|
|
||||||
*/
|
|
||||||
#define SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID}
|
|
||||||
/**
|
|
||||||
* Length of SNMP_DEVICE_ENTERPRISE_OID
|
|
||||||
*/
|
|
||||||
#define SNMP_DEVICE_ENTERPRISE_OID_LEN 7
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_DEBUG: Enable debugging for SNMP messages.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_DEBUG || defined __DOXYGEN__
|
|
||||||
#define SNMP_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_MIB_DEBUG || defined __DOXYGEN__
|
|
||||||
#define SNMP_MIB_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates if the MIB2 implementation of LWIP SNMP stack is used.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_MIB2 || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_MIB2 LWIP_SNMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Value return for sysDesc field of MIB2.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_MIB2_SYSDESC || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_MIB2_SYSDESC "lwIP"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Value return for sysName field of MIB2.
|
|
||||||
* To make sysName field settable, call snmp_mib2_set_sysname() to provide the necessary buffers.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_MIB2_SYSNAME || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_MIB2_SYSNAME "FQDN-unk"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Value return for sysContact field of MIB2.
|
|
||||||
* To make sysContact field settable, call snmp_mib2_set_syscontact() to provide the necessary buffers.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_MIB2_SYSCONTACT || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_MIB2_SYSCONTACT ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Value return for sysLocation field of MIB2.
|
|
||||||
* To make sysLocation field settable, call snmp_mib2_set_syslocation() to provide the necessary buffers.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_MIB2_SYSLOCATION || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_MIB2_SYSLOCATION ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This value is used to limit the repetitions processed in GetBulk requests (value == 0 means no limitation).
|
|
||||||
* This may be useful to limit the load for a single request.
|
|
||||||
* According to SNMP RFC 1905 it is allowed to not return all requested variables from a GetBulk request if system load would be too high.
|
|
||||||
* so the effect is that the client will do more requests to gather all data.
|
|
||||||
* For the stack this could be useful in case that SNMP processing is done in TCP/IP thread. In this situation a request with many
|
|
||||||
* repetitions could block the thread for a longer time. Setting limit here will keep the stack more responsive.
|
|
||||||
*/
|
|
||||||
#if !defined SNMP_LWIP_GETBULK_MAX_REPETITIONS || defined __DOXYGEN__
|
|
||||||
#define SNMP_LWIP_GETBULK_MAX_REPETITIONS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
------------------------------------
|
|
||||||
---------- SNMPv3 options ----------
|
|
||||||
------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* LWIP_SNMP_V3==1: This enables EXPERIMENTAL SNMPv3 support. LWIP_SNMP must
|
|
||||||
* also be enabled.
|
|
||||||
* THIS IS UNDER DEVELOPMENT AND SHOULD NOT BE ENABLED IN PRODUCTS.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_SNMP_V3
|
|
||||||
#define LWIP_SNMP_V3 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_SNMP_V3_MBEDTLS
|
|
||||||
#define LWIP_SNMP_V3_MBEDTLS LWIP_SNMP_V3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_SNMP_V3_CRYPTO
|
|
||||||
#define LWIP_SNMP_V3_CRYPTO LWIP_SNMP_V3_MBEDTLS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_SNMP_CONFIGURE_VERSIONS
|
|
||||||
#define LWIP_SNMP_CONFIGURE_VERSIONS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_SNMP_OPTS_H */
|
|
||||||
-113
@@ -1,113 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP server MIB API to implement scalar nodes
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Martin Hentschel <info@cl-soft.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_SCALAR_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_SCALAR_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/** basic scalar node */
|
|
||||||
struct snmp_scalar_node
|
|
||||||
{
|
|
||||||
/** inherited "base class" members */
|
|
||||||
struct snmp_leaf_node node;
|
|
||||||
u8_t asn1_type;
|
|
||||||
snmp_access_t access;
|
|
||||||
node_instance_get_value_method get_value;
|
|
||||||
node_instance_set_test_method set_test;
|
|
||||||
node_instance_set_value_method set_value;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
|
|
||||||
#define SNMP_SCALAR_CREATE_NODE(oid, access, asn1_type, get_value_method, set_test_method, set_value_method) \
|
|
||||||
{{{ SNMP_NODE_SCALAR, (oid) }, \
|
|
||||||
snmp_scalar_get_instance, \
|
|
||||||
snmp_scalar_get_next_instance }, \
|
|
||||||
(asn1_type), (access), (get_value_method), (set_test_method), (set_value_method) }
|
|
||||||
|
|
||||||
#define SNMP_SCALAR_CREATE_NODE_READONLY(oid, asn1_type, get_value_method) SNMP_SCALAR_CREATE_NODE(oid, SNMP_NODE_INSTANCE_READ_ONLY, asn1_type, get_value_method, NULL, NULL)
|
|
||||||
|
|
||||||
/** scalar array node - a tree node which contains scalars only as children */
|
|
||||||
struct snmp_scalar_array_node_def
|
|
||||||
{
|
|
||||||
u32_t oid;
|
|
||||||
u8_t asn1_type;
|
|
||||||
snmp_access_t access;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef s16_t (*snmp_scalar_array_get_value_method)(const struct snmp_scalar_array_node_def*, void*);
|
|
||||||
typedef snmp_err_t (*snmp_scalar_array_set_test_method)(const struct snmp_scalar_array_node_def*, u16_t, void*);
|
|
||||||
typedef snmp_err_t (*snmp_scalar_array_set_value_method)(const struct snmp_scalar_array_node_def*, u16_t, void*);
|
|
||||||
|
|
||||||
/** basic scalar array node */
|
|
||||||
struct snmp_scalar_array_node
|
|
||||||
{
|
|
||||||
/** inherited "base class" members */
|
|
||||||
struct snmp_leaf_node node;
|
|
||||||
u16_t array_node_count;
|
|
||||||
const struct snmp_scalar_array_node_def* array_nodes;
|
|
||||||
snmp_scalar_array_get_value_method get_value;
|
|
||||||
snmp_scalar_array_set_test_method set_test;
|
|
||||||
snmp_scalar_array_set_value_method set_value;
|
|
||||||
};
|
|
||||||
|
|
||||||
snmp_err_t snmp_scalar_array_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
|
|
||||||
#define SNMP_SCALAR_CREATE_ARRAY_NODE(oid, array_nodes, get_value_method, set_test_method, set_value_method) \
|
|
||||||
{{{ SNMP_NODE_SCALAR_ARRAY, (oid) }, \
|
|
||||||
snmp_scalar_array_get_instance, \
|
|
||||||
snmp_scalar_array_get_next_instance }, \
|
|
||||||
(u16_t)LWIP_ARRAYSIZE(array_nodes), (array_nodes), (get_value_method), (set_test_method), (set_value_method) }
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_SCALAR_H */
|
|
||||||
-32
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
Generated by LwipMibCompiler
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_FRAMEWORK_MIB_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_FRAMEWORK_MIB_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
#if LWIP_SNMP
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
extern const struct snmp_obj_id usmNoAuthProtocol;
|
|
||||||
extern const struct snmp_obj_id usmHMACMD5AuthProtocol;
|
|
||||||
extern const struct snmp_obj_id usmHMACSHAAuthProtocol;
|
|
||||||
|
|
||||||
extern const struct snmp_obj_id usmNoPrivProtocol;
|
|
||||||
extern const struct snmp_obj_id usmDESPrivProtocol;
|
|
||||||
extern const struct snmp_obj_id usmAESPrivProtocol;
|
|
||||||
|
|
||||||
extern const struct snmp_mib snmpframeworkmib;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_FRAMEWORK_MIB_H */
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
Generated by LwipMibCompiler
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_USER_BASED_SM_MIB_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_USER_BASED_SM_MIB_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
#if LWIP_SNMP
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
extern const struct snmp_mib snmpusmmib;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_USER_BASED_SM_MIB_H */
|
|
||||||
-134
@@ -1,134 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP server MIB API to implement table nodes
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Martin Hentschel <info@cl-soft.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_TABLE_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_TABLE_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/** default (customizable) read/write table */
|
|
||||||
struct snmp_table_col_def
|
|
||||||
{
|
|
||||||
u32_t index;
|
|
||||||
u8_t asn1_type;
|
|
||||||
snmp_access_t access;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** table node */
|
|
||||||
struct snmp_table_node
|
|
||||||
{
|
|
||||||
/** inherited "base class" members */
|
|
||||||
struct snmp_leaf_node node;
|
|
||||||
u16_t column_count;
|
|
||||||
const struct snmp_table_col_def* columns;
|
|
||||||
snmp_err_t (*get_cell_instance)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, struct snmp_node_instance* cell_instance);
|
|
||||||
snmp_err_t (*get_next_cell_instance)(const u32_t* column, struct snmp_obj_id* row_oid, struct snmp_node_instance* cell_instance);
|
|
||||||
/** returns object value for the given object identifier */
|
|
||||||
node_instance_get_value_method get_value;
|
|
||||||
/** tests length and/or range BEFORE setting */
|
|
||||||
node_instance_set_test_method set_test;
|
|
||||||
/** sets object value, only called when set_test() was successful */
|
|
||||||
node_instance_set_value_method set_value;
|
|
||||||
};
|
|
||||||
|
|
||||||
snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
|
|
||||||
#define SNMP_TABLE_CREATE(oid, columns, get_cell_instance_method, get_next_cell_instance_method, get_value_method, set_test_method, set_value_method) \
|
|
||||||
{{{ SNMP_NODE_TABLE, (oid) }, \
|
|
||||||
snmp_table_get_instance, \
|
|
||||||
snmp_table_get_next_instance }, \
|
|
||||||
(u16_t)LWIP_ARRAYSIZE(columns), (columns), \
|
|
||||||
(get_cell_instance_method), (get_next_cell_instance_method), \
|
|
||||||
(get_value_method), (set_test_method), (set_value_method)}
|
|
||||||
|
|
||||||
#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */
|
|
||||||
|
|
||||||
|
|
||||||
/** simple read-only table */
|
|
||||||
typedef enum {
|
|
||||||
SNMP_VARIANT_VALUE_TYPE_U32,
|
|
||||||
SNMP_VARIANT_VALUE_TYPE_S32,
|
|
||||||
SNMP_VARIANT_VALUE_TYPE_PTR,
|
|
||||||
SNMP_VARIANT_VALUE_TYPE_CONST_PTR
|
|
||||||
} snmp_table_column_data_type_t;
|
|
||||||
|
|
||||||
struct snmp_table_simple_col_def
|
|
||||||
{
|
|
||||||
u32_t index;
|
|
||||||
u8_t asn1_type;
|
|
||||||
snmp_table_column_data_type_t data_type; /* depending of what union member is used to store the value*/
|
|
||||||
};
|
|
||||||
|
|
||||||
/** simple read-only table node */
|
|
||||||
struct snmp_table_simple_node
|
|
||||||
{
|
|
||||||
/* inherited "base class" members */
|
|
||||||
struct snmp_leaf_node node;
|
|
||||||
u16_t column_count;
|
|
||||||
const struct snmp_table_simple_col_def* columns;
|
|
||||||
snmp_err_t (*get_cell_value)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len);
|
|
||||||
snmp_err_t (*get_next_cell_instance_and_value)(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len);
|
|
||||||
};
|
|
||||||
|
|
||||||
snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
|
|
||||||
#define SNMP_TABLE_CREATE_SIMPLE(oid, columns, get_cell_value_method, get_next_cell_instance_and_value_method) \
|
|
||||||
{{{ SNMP_NODE_TABLE, (oid) }, \
|
|
||||||
snmp_table_simple_get_instance, \
|
|
||||||
snmp_table_simple_get_next_instance }, \
|
|
||||||
(u16_t)LWIP_ARRAYSIZE(columns), (columns), (get_cell_value_method), (get_next_cell_instance_and_value_method) }
|
|
||||||
|
|
||||||
s16_t snmp_table_extract_value_from_s32ref(struct snmp_node_instance* instance, void* value);
|
|
||||||
s16_t snmp_table_extract_value_from_u32ref(struct snmp_node_instance* instance, void* value);
|
|
||||||
s16_t snmp_table_extract_value_from_refconstptr(struct snmp_node_instance* instance, void* value);
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_TABLE_H */
|
|
||||||
-114
@@ -1,114 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNMP server MIB API to implement thread synchronization
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Dirk Ziegelmeier <dziegel@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_THREADSYNC_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_THREADSYNC_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_core.h"
|
|
||||||
#include "lwip/sys.h"
|
|
||||||
|
|
||||||
typedef void (*snmp_threadsync_called_fn)(void* arg);
|
|
||||||
typedef void (*snmp_threadsync_synchronizer_fn)(snmp_threadsync_called_fn fn, void* arg);
|
|
||||||
|
|
||||||
|
|
||||||
/** Thread sync runtime data. For internal usage only. */
|
|
||||||
struct threadsync_data
|
|
||||||
{
|
|
||||||
union {
|
|
||||||
snmp_err_t err;
|
|
||||||
s16_t s16;
|
|
||||||
} retval;
|
|
||||||
union {
|
|
||||||
const u32_t *root_oid;
|
|
||||||
void *value;
|
|
||||||
} arg1;
|
|
||||||
union {
|
|
||||||
u8_t root_oid_len;
|
|
||||||
u16_t len;
|
|
||||||
} arg2;
|
|
||||||
const struct snmp_threadsync_node *threadsync_node;
|
|
||||||
struct snmp_node_instance proxy_instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Thread sync instance. Needed EXACTLY once for every thread to be synced into. */
|
|
||||||
struct snmp_threadsync_instance
|
|
||||||
{
|
|
||||||
sys_sem_t sem;
|
|
||||||
sys_mutex_t sem_usage_mutex;
|
|
||||||
snmp_threadsync_synchronizer_fn sync_fn;
|
|
||||||
struct threadsync_data data;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** SNMP thread sync proxy leaf node */
|
|
||||||
struct snmp_threadsync_node
|
|
||||||
{
|
|
||||||
/* inherited "base class" members */
|
|
||||||
struct snmp_leaf_node node;
|
|
||||||
|
|
||||||
const struct snmp_leaf_node *target;
|
|
||||||
struct snmp_threadsync_instance *instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
snmp_err_t snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
snmp_err_t snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);
|
|
||||||
|
|
||||||
/** Create thread sync proxy node */
|
|
||||||
#define SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance) \
|
|
||||||
{{{ SNMP_NODE_THREADSYNC, (oid) }, \
|
|
||||||
snmp_threadsync_get_instance, \
|
|
||||||
snmp_threadsync_get_next_instance }, \
|
|
||||||
(target_leaf_node), \
|
|
||||||
(threadsync_instance) }
|
|
||||||
|
|
||||||
/** Create thread sync instance data */
|
|
||||||
void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn);
|
|
||||||
|
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_THREADSYNC_H */
|
|
||||||
-114
@@ -1,114 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Additional SNMPv3 functionality RFC3414 and RFC3826.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Elias Oenal.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* Author: Elias Oenal <lwip@eliasoenal.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_SNMP_V3_H
|
|
||||||
#define LWIP_HDR_APPS_SNMP_V3_H
|
|
||||||
|
|
||||||
#include "lwip/apps/snmp_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_SNMP && LWIP_SNMP_V3
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SNMP_V3_AUTH_ALGO_INVAL = 0,
|
|
||||||
SNMP_V3_AUTH_ALGO_MD5 = 1,
|
|
||||||
SNMP_V3_AUTH_ALGO_SHA = 2
|
|
||||||
} snmpv3_auth_algo_t;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SNMP_V3_PRIV_ALGO_INVAL = 0,
|
|
||||||
SNMP_V3_PRIV_ALGO_DES = 1,
|
|
||||||
SNMP_V3_PRIV_ALGO_AES = 2
|
|
||||||
} snmpv3_priv_algo_t;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SNMP_V3_USER_STORAGETYPE_OTHER = 1,
|
|
||||||
SNMP_V3_USER_STORAGETYPE_VOLATILE = 2,
|
|
||||||
SNMP_V3_USER_STORAGETYPE_NONVOLATILE = 3,
|
|
||||||
SNMP_V3_USER_STORAGETYPE_PERMANENT = 4,
|
|
||||||
SNMP_V3_USER_STORAGETYPE_READONLY = 5
|
|
||||||
} snmpv3_user_storagetype_t;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following callback functions must be implemented by the application.
|
|
||||||
* There is a dummy implementation in snmpv3_dummy.c.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void snmpv3_get_engine_id(const char **id, u8_t *len);
|
|
||||||
err_t snmpv3_set_engine_id(const char* id, u8_t len);
|
|
||||||
|
|
||||||
u32_t snmpv3_get_engine_boots(void);
|
|
||||||
void snmpv3_set_engine_boots(u32_t boots);
|
|
||||||
|
|
||||||
u32_t snmpv3_get_engine_time(void);
|
|
||||||
void snmpv3_reset_engine_time(void);
|
|
||||||
|
|
||||||
err_t snmpv3_get_user(const char* username, snmpv3_auth_algo_t *auth_algo, u8_t *auth_key, snmpv3_priv_algo_t *priv_algo, u8_t *priv_key);
|
|
||||||
u8_t snmpv3_get_amount_of_users(void);
|
|
||||||
err_t snmpv3_get_user_storagetype(const char *username, snmpv3_user_storagetype_t *storagetype);
|
|
||||||
err_t snmpv3_get_username(char *username, u8_t index);
|
|
||||||
|
|
||||||
/* The following functions are provided by the SNMPv3 agent */
|
|
||||||
|
|
||||||
void snmpv3_engine_id_changed(void);
|
|
||||||
s32_t snmpv3_get_engine_time_internal(void);
|
|
||||||
|
|
||||||
void snmpv3_password_to_key_md5(
|
|
||||||
const u8_t *password, /* IN */
|
|
||||||
size_t passwordlen, /* IN */
|
|
||||||
const u8_t *engineID, /* IN - pointer to snmpEngineID */
|
|
||||||
u8_t engineLength, /* IN - length of snmpEngineID */
|
|
||||||
u8_t *key); /* OUT - pointer to caller 16-octet buffer */
|
|
||||||
|
|
||||||
void snmpv3_password_to_key_sha(
|
|
||||||
const u8_t *password, /* IN */
|
|
||||||
size_t passwordlen, /* IN */
|
|
||||||
const u8_t *engineID, /* IN - pointer to snmpEngineID */
|
|
||||||
u8_t engineLength, /* IN - length of snmpEngineID */
|
|
||||||
u8_t *key); /* OUT - pointer to caller 20-octet buffer */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNMP_V3_H */
|
|
||||||
-80
@@ -1,80 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNTP client API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Frédéric Bernon, Simon Goldschmidt
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_SNTP_H
|
|
||||||
#define LWIP_HDR_APPS_SNTP_H
|
|
||||||
|
|
||||||
#include "lwip/apps/sntp_opts.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SNTP operating modes: default is to poll using unicast.
|
|
||||||
The mode has to be set before calling sntp_init(). */
|
|
||||||
#define SNTP_OPMODE_POLL 0
|
|
||||||
#define SNTP_OPMODE_LISTENONLY 1
|
|
||||||
void sntp_setoperatingmode(u8_t operating_mode);
|
|
||||||
u8_t sntp_getoperatingmode(void);
|
|
||||||
|
|
||||||
void sntp_init(void);
|
|
||||||
void sntp_stop(void);
|
|
||||||
u8_t sntp_enabled(void);
|
|
||||||
|
|
||||||
void sntp_setserver(u8_t idx, const ip_addr_t *addr);
|
|
||||||
const ip_addr_t* sntp_getserver(u8_t idx);
|
|
||||||
|
|
||||||
#if SNTP_MONITOR_SERVER_REACHABILITY
|
|
||||||
u8_t sntp_getreachability(u8_t idx);
|
|
||||||
#endif /* SNTP_MONITOR_SERVER_REACHABILITY */
|
|
||||||
|
|
||||||
#if SNTP_SERVER_DNS
|
|
||||||
void sntp_setservername(u8_t idx, const char *server);
|
|
||||||
const char *sntp_getservername(u8_t idx);
|
|
||||||
#endif /* SNTP_SERVER_DNS */
|
|
||||||
|
|
||||||
#if SNTP_GET_SERVERS_FROM_DHCP || SNTP_GET_SERVERS_FROM_DHCPV6
|
|
||||||
void sntp_servermode_dhcp(int set_servers_from_dhcp);
|
|
||||||
#else /* SNTP_GET_SERVERS_FROM_DHCP || SNTP_GET_SERVERS_FROM_DHCPV6 */
|
|
||||||
#define sntp_servermode_dhcp(x)
|
|
||||||
#endif /* SNTP_GET_SERVERS_FROM_DHCP || SNTP_GET_SERVERS_FROM_DHCPV6 */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNTP_H */
|
|
||||||
-215
@@ -1,215 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* SNTP client options list
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Frédéric Bernon, Simon Goldschmidt
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_APPS_SNTP_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_SNTP_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup sntp_opts Options
|
|
||||||
* @ingroup sntp
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** SNTP macro to change system time in seconds
|
|
||||||
* Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds
|
|
||||||
* instead of this one if you need the additional precision. Alternatively,
|
|
||||||
* define SNTP_SET_SYSTEM_TIME_NTP(sec, frac) in order to work with native
|
|
||||||
* NTP timestamps instead.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_SET_SYSTEM_TIME || defined __DOXYGEN__
|
|
||||||
#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The maximum number of SNTP servers that can be set */
|
|
||||||
#if !defined SNTP_MAX_SERVERS || defined __DOXYGEN__
|
|
||||||
#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to implement the callback function called by dhcp when
|
|
||||||
* NTP servers are received. */
|
|
||||||
#if !defined SNTP_GET_SERVERS_FROM_DHCP || defined __DOXYGEN__
|
|
||||||
#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to implement the callback function called by dhcpv6 when
|
|
||||||
* NTP servers are received. */
|
|
||||||
#if !defined SNTP_GET_SERVERS_FROM_DHCPV6 || defined __DOXYGEN__
|
|
||||||
#define SNTP_GET_SERVERS_FROM_DHCPV6 LWIP_DHCP6_GET_NTP_SRV
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Set this to 1 to support DNS names (or IP address strings) to set sntp servers
|
|
||||||
* One server address/name can be defined as default if SNTP_SERVER_DNS == 1:
|
|
||||||
* \#define SNTP_SERVER_ADDRESS "pool.ntp.org"
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__
|
|
||||||
#define SNTP_SERVER_DNS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SNTP_DEBUG: Enable debugging for SNTP.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_DEBUG || defined __DOXYGEN__
|
|
||||||
#define SNTP_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** SNTP server port */
|
|
||||||
#if !defined SNTP_PORT || defined __DOXYGEN__
|
|
||||||
#define SNTP_PORT LWIP_IANA_PORT_SNTP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Sanity check:
|
|
||||||
* Define this to
|
|
||||||
* - 0 to turn off sanity checks (default; smaller code)
|
|
||||||
* - >= 1 to check address and port of the response packet to ensure the
|
|
||||||
* response comes from the server we sent the request to.
|
|
||||||
* - >= 2 to check returned Originate Timestamp against Transmit Timestamp
|
|
||||||
* sent to the server (to ensure response to older request).
|
|
||||||
* - >= 3 @todo: discard reply if any of the VN, Stratum, or Transmit Timestamp
|
|
||||||
* fields is 0 or the Mode field is not 4 (unicast) or 5 (broadcast).
|
|
||||||
* - >= 4 @todo: to check that the Root Delay and Root Dispersion fields are each
|
|
||||||
* greater than or equal to 0 and less than infinity, where infinity is
|
|
||||||
* currently a cozy number like one second. This check avoids using a
|
|
||||||
* server whose synchronization source has expired for a very long time.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_CHECK_RESPONSE || defined __DOXYGEN__
|
|
||||||
#define SNTP_CHECK_RESPONSE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Enable round-trip delay compensation.
|
|
||||||
* Compensate for the round-trip delay by calculating the clock offset from
|
|
||||||
* the originate, receive, transmit and destination timestamps, as per RFC.
|
|
||||||
*
|
|
||||||
* The calculation requires compiler support for 64-bit integers. Also, either
|
|
||||||
* SNTP_SET_SYSTEM_TIME_US or SNTP_SET_SYSTEM_TIME_NTP has to be implemented
|
|
||||||
* for setting the system clock with sub-second precision. Likewise, either
|
|
||||||
* SNTP_GET_SYSTEM_TIME or SNTP_GET_SYSTEM_TIME_NTP needs to be implemented
|
|
||||||
* with sub-second precision.
|
|
||||||
*
|
|
||||||
* Although not strictly required, it makes sense to combine this option with
|
|
||||||
* SNTP_CHECK_RESPONSE >= 2 for sanity-checking of the received timestamps.
|
|
||||||
* Also, in order for the round-trip calculation to work, the difference
|
|
||||||
* between the local clock and the NTP server clock must not be larger than
|
|
||||||
* about 34 years. If that limit is exceeded, the implementation will fall back
|
|
||||||
* to setting the clock without compensation. In order to ensure that the local
|
|
||||||
* clock is always within the permitted range for compensation, even at first
|
|
||||||
* try, it may be necessary to store at least the current year in non-volatile
|
|
||||||
* memory.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_COMP_ROUNDTRIP || defined __DOXYGEN__
|
|
||||||
#define SNTP_COMP_ROUNDTRIP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** According to the RFC, this shall be a random delay
|
|
||||||
* between 1 and 5 minutes (in milliseconds) to prevent load peaks.
|
|
||||||
* This can be defined to a random generation function,
|
|
||||||
* which must return the delay in milliseconds as u32_t.
|
|
||||||
* Turned off by default.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__
|
|
||||||
#ifdef LWIP_RAND
|
|
||||||
#define SNTP_STARTUP_DELAY 1
|
|
||||||
#else
|
|
||||||
#define SNTP_STARTUP_DELAY 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** If you want the startup delay to be a function, define this
|
|
||||||
* to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__
|
|
||||||
#define SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** SNTP receive timeout - in milliseconds
|
|
||||||
* Also used as retry timeout - this shouldn't be too low.
|
|
||||||
* Default is 15 seconds. Must not be beolw 15 seconds by specification (i.e. 15000)
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_RECV_TIMEOUT || defined __DOXYGEN__
|
|
||||||
#define SNTP_RECV_TIMEOUT 15000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** SNTP update delay - in milliseconds
|
|
||||||
* Default is 1 hour. Must not be beolw 60 seconds by specification (i.e. 60000)
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_UPDATE_DELAY || defined __DOXYGEN__
|
|
||||||
#define SNTP_UPDATE_DELAY 3600000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2
|
|
||||||
* to send in request and compare in response. Also used for round-trip
|
|
||||||
* delay compensation if SNTP_COMP_ROUNDTRIP != 0.
|
|
||||||
* Alternatively, define SNTP_GET_SYSTEM_TIME_NTP(sec, frac) in order to
|
|
||||||
* work with native NTP timestamps instead.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_GET_SYSTEM_TIME || defined __DOXYGEN__
|
|
||||||
#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Default retry timeout (in milliseconds) if the response
|
|
||||||
* received is invalid.
|
|
||||||
* This is doubled with each retry until SNTP_RETRY_TIMEOUT_MAX is reached.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_RETRY_TIMEOUT || defined __DOXYGEN__
|
|
||||||
#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Maximum retry timeout (in milliseconds). */
|
|
||||||
#if !defined SNTP_RETRY_TIMEOUT_MAX || defined __DOXYGEN__
|
|
||||||
#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Increase retry timeout with every retry sent
|
|
||||||
* Default is on to conform to RFC.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_RETRY_TIMEOUT_EXP || defined __DOXYGEN__
|
|
||||||
#define SNTP_RETRY_TIMEOUT_EXP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Keep a reachability shift register per server
|
|
||||||
* Default is on to conform to RFC.
|
|
||||||
*/
|
|
||||||
#if !defined SNTP_MONITOR_SERVER_REACHABILITY || defined __DOXYGEN__
|
|
||||||
#define SNTP_MONITOR_SERVER_REACHABILITY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_SNTP_OPTS_H */
|
|
||||||
-106
@@ -1,106 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* @file tftp_opts.h
|
|
||||||
*
|
|
||||||
* @author Logan Gunthorpe <logang@deltatee.com>
|
|
||||||
*
|
|
||||||
* @brief Trivial File Transfer Protocol (RFC 1350) implementation options
|
|
||||||
*
|
|
||||||
* Copyright (c) Deltatee Enterprises Ltd. 2013
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification,are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* Author: Logan Gunthorpe <logang@deltatee.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_TFTP_OPTS_H
|
|
||||||
#define LWIP_HDR_APPS_TFTP_OPTS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/prot/iana.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup tftp_opts Options
|
|
||||||
* @ingroup tftp
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable TFTP debug messages
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_DEBUG || defined __DOXYGEN__
|
|
||||||
#define TFTP_DEBUG LWIP_DBG_OFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TFTP server port
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_PORT || defined __DOXYGEN__
|
|
||||||
#define TFTP_PORT LWIP_IANA_PORT_TFTP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TFTP timeout
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__
|
|
||||||
#define TFTP_TIMEOUT_MSECS 10000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Max. number of retries when a file is read from server
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__
|
|
||||||
#define TFTP_MAX_RETRIES 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TFTP timer cyclic interval
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__
|
|
||||||
#define TFTP_TIMER_MSECS (TFTP_TIMEOUT_MSECS / 10)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Max. length of TFTP filename
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__
|
|
||||||
#define TFTP_MAX_FILENAME_LEN 20
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Max. length of TFTP mode
|
|
||||||
*/
|
|
||||||
#if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__
|
|
||||||
#define TFTP_MAX_MODE_LEN 7
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_TFTP_OPTS_H */
|
|
||||||
-95
@@ -1,95 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* @file tftp_server.h
|
|
||||||
*
|
|
||||||
* @author Logan Gunthorpe <logang@deltatee.com>
|
|
||||||
*
|
|
||||||
* @brief Trivial File Transfer Protocol (RFC 1350)
|
|
||||||
*
|
|
||||||
* Copyright (c) Deltatee Enterprises Ltd. 2013
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification,are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* Author: Logan Gunthorpe <logang@deltatee.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_TFTP_SERVER_H
|
|
||||||
#define LWIP_HDR_APPS_TFTP_SERVER_H
|
|
||||||
|
|
||||||
#include "lwip/apps/tftp_opts.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @ingroup tftp
|
|
||||||
* TFTP context containing callback functions for TFTP transfers
|
|
||||||
*/
|
|
||||||
struct tftp_context {
|
|
||||||
/**
|
|
||||||
* Open file for read/write.
|
|
||||||
* @param fname Filename
|
|
||||||
* @param mode Mode string from TFTP RFC 1350 (netascii, octet, mail)
|
|
||||||
* @param write Flag indicating read (0) or write (!= 0) access
|
|
||||||
* @returns File handle supplied to other functions
|
|
||||||
*/
|
|
||||||
void* (*open)(const char* fname, const char* mode, u8_t write);
|
|
||||||
/**
|
|
||||||
* Close file handle
|
|
||||||
* @param handle File handle returned by open()
|
|
||||||
*/
|
|
||||||
void (*close)(void* handle);
|
|
||||||
/**
|
|
||||||
* Read from file
|
|
||||||
* @param handle File handle returned by open()
|
|
||||||
* @param buf Target buffer to copy read data to
|
|
||||||
* @param bytes Number of bytes to copy to buf
|
|
||||||
* @returns >= 0: Success; < 0: Error
|
|
||||||
*/
|
|
||||||
int (*read)(void* handle, void* buf, int bytes);
|
|
||||||
/**
|
|
||||||
* Write to file
|
|
||||||
* @param handle File handle returned by open()
|
|
||||||
* @param pbuf PBUF adjusted such that payload pointer points
|
|
||||||
* to the beginning of write data. In other words,
|
|
||||||
* TFTP headers are stripped off.
|
|
||||||
* @returns >= 0: Success; < 0: Error
|
|
||||||
*/
|
|
||||||
int (*write)(void* handle, struct pbuf* p);
|
|
||||||
};
|
|
||||||
|
|
||||||
err_t tftp_init(const struct tftp_context* ctx);
|
|
||||||
void tftp_cleanup(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_TFTP_SERVER_H */
|
|
||||||
-393
@@ -1,393 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Support for different processor and compiler architectures
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ARCH_H
|
|
||||||
#define LWIP_HDR_ARCH_H
|
|
||||||
|
|
||||||
#ifndef LITTLE_ENDIAN
|
|
||||||
#define LITTLE_ENDIAN 1234
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BIG_ENDIAN
|
|
||||||
#define BIG_ENDIAN 4321
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "arch/cc.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup compiler_abstraction Compiler/platform abstraction
|
|
||||||
* @ingroup sys_layer
|
|
||||||
* All defines related to this section must not be placed in lwipopts.h,
|
|
||||||
* but in arch/cc.h!
|
|
||||||
* If the compiler does not provide memset() this file must include a
|
|
||||||
* definition of it, or include a file which defines it.
|
|
||||||
* These options cannot be \#defined in lwipopts.h since they are not options
|
|
||||||
* of lwIP itself, but options of the lwIP port to your system.
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Define the byte order of the system.
|
|
||||||
* Needed for conversion of network data to host byte order.
|
|
||||||
* Allowed values: LITTLE_ENDIAN and BIG_ENDIAN
|
|
||||||
*/
|
|
||||||
#ifndef BYTE_ORDER
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Define random number generator function of your system */
|
|
||||||
#ifdef __DOXYGEN__
|
|
||||||
#define LWIP_RAND() ((u32_t)rand())
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Platform specific diagnostic output.\n
|
|
||||||
* Note the default implementation pulls in printf, which may
|
|
||||||
* in turn pull in a lot of standard library code. In resource-constrained
|
|
||||||
* systems, this should be defined to something less resource-consuming.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_PLATFORM_DIAG
|
|
||||||
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Platform specific assertion handling.\n
|
|
||||||
* Note the default implementation pulls in printf, fflush and abort, which may
|
|
||||||
* in turn pull in a lot of standard library code. In resource-constrained
|
|
||||||
* systems, this should be defined to something less resource-consuming.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_PLATFORM_ASSERT
|
|
||||||
#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \
|
|
||||||
x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if you do not want to
|
|
||||||
* include stddef.h header to get size_t. You need to typedef size_t
|
|
||||||
* by yourself in this case.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_NO_STDDEF_H
|
|
||||||
#define LWIP_NO_STDDEF_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !LWIP_NO_STDDEF_H
|
|
||||||
#include <stddef.h> /* for size_t */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
|
||||||
* the stdint.h header. You need to typedef the generic types listed in
|
|
||||||
* lwip/arch.h yourself in this case (u8_t, u16_t...).
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_NO_STDINT_H
|
|
||||||
#define LWIP_NO_STDINT_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define generic types used in lwIP */
|
|
||||||
#if !LWIP_NO_STDINT_H
|
|
||||||
#include <stdint.h>
|
|
||||||
/* stdint.h is C99 which should also provide support for 64-bit integers */
|
|
||||||
#if !defined(LWIP_HAVE_INT64) && defined(UINT64_MAX)
|
|
||||||
#define LWIP_HAVE_INT64 1
|
|
||||||
#endif
|
|
||||||
typedef uint8_t u8_t;
|
|
||||||
typedef int8_t s8_t;
|
|
||||||
typedef uint16_t u16_t;
|
|
||||||
typedef int16_t s16_t;
|
|
||||||
typedef uint32_t u32_t;
|
|
||||||
typedef int32_t s32_t;
|
|
||||||
#if LWIP_HAVE_INT64
|
|
||||||
typedef uint64_t u64_t;
|
|
||||||
typedef int64_t s64_t;
|
|
||||||
#endif
|
|
||||||
typedef uintptr_t mem_ptr_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
|
||||||
* the inttypes.h header. You need to define the format strings listed in
|
|
||||||
* lwip/arch.h yourself in this case (X8_F, U16_F...).
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_NO_INTTYPES_H
|
|
||||||
#define LWIP_NO_INTTYPES_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define (sn)printf formatters for these lwIP types */
|
|
||||||
#if !LWIP_NO_INTTYPES_H
|
|
||||||
#include <inttypes.h>
|
|
||||||
#ifndef X8_F
|
|
||||||
#define X8_F "02" PRIx8
|
|
||||||
#endif
|
|
||||||
#ifndef U16_F
|
|
||||||
#define U16_F PRIu16
|
|
||||||
#endif
|
|
||||||
#ifndef S16_F
|
|
||||||
#define S16_F PRId16
|
|
||||||
#endif
|
|
||||||
#ifndef X16_F
|
|
||||||
#define X16_F PRIx16
|
|
||||||
#endif
|
|
||||||
#ifndef U32_F
|
|
||||||
#define U32_F PRIu32
|
|
||||||
#endif
|
|
||||||
#ifndef S32_F
|
|
||||||
#define S32_F PRId32
|
|
||||||
#endif
|
|
||||||
#ifndef X32_F
|
|
||||||
#define X32_F PRIx32
|
|
||||||
#endif
|
|
||||||
#ifndef SZT_F
|
|
||||||
#define SZT_F PRIuPTR
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
|
||||||
* the limits.h header. You need to define the type limits yourself in this case
|
|
||||||
* (e.g. INT_MAX, SSIZE_MAX).
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_NO_LIMITS_H
|
|
||||||
#define LWIP_NO_LIMITS_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Include limits.h? */
|
|
||||||
#if !LWIP_NO_LIMITS_H
|
|
||||||
#include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Do we need to define ssize_t? This is a compatibility hack:
|
|
||||||
* Unfortunately, this type seems to be unavailable on some systems (even if
|
|
||||||
* sys/types or unistd.h are available).
|
|
||||||
* Being like that, we define it to 'int' if SSIZE_MAX is not defined.
|
|
||||||
*/
|
|
||||||
#ifdef SSIZE_MAX
|
|
||||||
/* If SSIZE_MAX is defined, unistd.h should provide the type as well */
|
|
||||||
#ifndef LWIP_NO_UNISTD_H
|
|
||||||
#define LWIP_NO_UNISTD_H 0
|
|
||||||
#endif
|
|
||||||
#if !LWIP_NO_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#else /* SSIZE_MAX */
|
|
||||||
//typedef int ssize_t;
|
|
||||||
#define SSIZE_MAX LONG_MAX
|
|
||||||
#endif /* SSIZE_MAX */
|
|
||||||
|
|
||||||
/* some maximum values needed in lwip code */
|
|
||||||
#define LWIP_UINT32_MAX 0xffffffff
|
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
|
||||||
* the ctype.h header. If ctype.h is available, a few character functions
|
|
||||||
* are mapped to the appropriate functions (lwip_islower, lwip_isdigit...), if
|
|
||||||
* not, a private implementation is provided.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_NO_CTYPE_H
|
|
||||||
#define LWIP_NO_CTYPE_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_NO_CTYPE_H
|
|
||||||
#define lwip_in_range(c, lo, up) ((u8_t)(c) >= (lo) && (u8_t)(c) <= (up))
|
|
||||||
#define lwip_isdigit(c) lwip_in_range((c), '0', '9')
|
|
||||||
#define lwip_isxdigit(c) (lwip_isdigit(c) || lwip_in_range((c), 'a', 'f') || lwip_in_range((c), 'A', 'F'))
|
|
||||||
#define lwip_islower(c) lwip_in_range((c), 'a', 'z')
|
|
||||||
#define lwip_isspace(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t' || (c) == '\v')
|
|
||||||
#define lwip_isupper(c) lwip_in_range((c), 'A', 'Z')
|
|
||||||
#define lwip_tolower(c) (lwip_isupper(c) ? (c) - 'A' + 'a' : c)
|
|
||||||
#define lwip_toupper(c) (lwip_islower(c) ? (c) - 'a' + 'A' : c)
|
|
||||||
#else
|
|
||||||
#include <ctype.h>
|
|
||||||
#define lwip_isdigit(c) isdigit((unsigned char)(c))
|
|
||||||
#define lwip_isxdigit(c) isxdigit((unsigned char)(c))
|
|
||||||
#define lwip_islower(c) islower((unsigned char)(c))
|
|
||||||
#define lwip_isspace(c) isspace((unsigned char)(c))
|
|
||||||
#define lwip_isupper(c) isupper((unsigned char)(c))
|
|
||||||
#define lwip_tolower(c) tolower((unsigned char)(c))
|
|
||||||
#define lwip_toupper(c) toupper((unsigned char)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** C++ const_cast<target_type>(val) equivalent to remove constness from a value (GCC -Wcast-qual) */
|
|
||||||
#ifndef LWIP_CONST_CAST
|
|
||||||
#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Get rid of alignment cast warnings (GCC -Wcast-align) */
|
|
||||||
#ifndef LWIP_ALIGNMENT_CAST
|
|
||||||
#define LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Get rid of warnings related to pointer-to-numeric and vice-versa casts,
|
|
||||||
* e.g. "conversion from 'u8_t' to 'void *' of greater size"
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_PTR_NUMERIC_CAST
|
|
||||||
#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast */
|
|
||||||
#ifndef LWIP_PACKED_CAST
|
|
||||||
#define LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Allocates a memory buffer of specified size that is of sufficient size to align
|
|
||||||
* its start address using LWIP_MEM_ALIGN.
|
|
||||||
* You can declare your own version here e.g. to enforce alignment without adding
|
|
||||||
* trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement
|
|
||||||
* requirements.\n
|
|
||||||
* e.g. if you use gcc and need 32 bit alignment:\n
|
|
||||||
* \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] \_\_attribute\_\_((aligned(4)))\n
|
|
||||||
* or more portable:\n
|
|
||||||
* \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)]
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_DECLARE_MEMORY_ALIGNED
|
|
||||||
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)]
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Calculate memory size for an aligned buffer - returns the next highest
|
|
||||||
* multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and
|
|
||||||
* LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4).
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_MEM_ALIGN_SIZE
|
|
||||||
#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Calculate safe memory size for an aligned buffer when using an unaligned
|
|
||||||
* type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the
|
|
||||||
* start (e.g. if buffer is u8_t[] and actual data will be u32_t*)
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_MEM_ALIGN_BUFFER
|
|
||||||
#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Align a memory pointer to the alignment defined by MEM_ALIGNMENT
|
|
||||||
* so that ADDR % MEM_ALIGNMENT == 0
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_MEM_ALIGN
|
|
||||||
#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Placed BEFORE declaration of a packed struct.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_BEGIN
|
|
||||||
#define PACK_STRUCT_BEGIN
|
|
||||||
#endif /* PACK_STRUCT_BEGIN */
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Placed AFTER declaration of a packed struct.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_END
|
|
||||||
#define PACK_STRUCT_END
|
|
||||||
#endif /* PACK_STRUCT_END */
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Placed between end of declaration of a packed struct and trailing semicolon.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_STRUCT
|
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
|
||||||
#define PACK_STRUCT_STRUCT __attribute__((packed))
|
|
||||||
#else
|
|
||||||
#define PACK_STRUCT_STRUCT
|
|
||||||
#endif
|
|
||||||
#endif /* PACK_STRUCT_STRUCT */
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Wraps u32_t and u16_t members.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_FIELD
|
|
||||||
#define PACK_STRUCT_FIELD(x) x
|
|
||||||
#endif /* PACK_STRUCT_FIELD */
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Wraps u8_t members, where some compilers warn that packing is not necessary.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_FLD_8
|
|
||||||
#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x)
|
|
||||||
#endif /* PACK_STRUCT_FLD_8 */
|
|
||||||
|
|
||||||
/** Packed structs support.
|
|
||||||
* Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.\n
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifndef PACK_STRUCT_FLD_S
|
|
||||||
#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x)
|
|
||||||
#endif /* PACK_STRUCT_FLD_S */
|
|
||||||
|
|
||||||
/** PACK_STRUCT_USE_INCLUDES==1: Packed structs support using \#include files before and after struct to be packed.\n
|
|
||||||
* The file included BEFORE the struct is "arch/bpstruct.h".\n
|
|
||||||
* The file included AFTER the struct is "arch/epstruct.h".\n
|
|
||||||
* This can be used to implement struct packing on MS Visual C compilers, see
|
|
||||||
* the Win32 port in the lwIP contrib repository for reference.
|
|
||||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
|
||||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
|
||||||
*/
|
|
||||||
#ifdef __DOXYGEN__
|
|
||||||
#define PACK_STRUCT_USE_INCLUDES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused). */
|
|
||||||
#ifndef LWIP_UNUSED_ARG
|
|
||||||
#define LWIP_UNUSED_ARG(x) (void)x
|
|
||||||
#endif /* LWIP_UNUSED_ARG */
|
|
||||||
|
|
||||||
/** LWIP_PROVIDE_ERRNO==1: Let lwIP provide ERRNO values and the 'errno' variable.
|
|
||||||
* If this is disabled, cc.h must either define 'errno', include <errno.h>,
|
|
||||||
* define LWIP_ERRNO_STDINCLUDE to get <errno.h> included or
|
|
||||||
* define LWIP_ERRNO_INCLUDE to <errno.h> or equivalent.
|
|
||||||
*/
|
|
||||||
#if defined __DOXYGEN__
|
|
||||||
#define LWIP_PROVIDE_ERRNO
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ARCH_H */
|
|
||||||
-99
@@ -1,99 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* AutoIP Automatic LinkLocal IP Configuration
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2007 Dominik Spies <kontakt@dspies.de>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* Author: Dominik Spies <kontakt@dspies.de>
|
|
||||||
*
|
|
||||||
* This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform
|
|
||||||
* with RFC 3927.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_AUTOIP_H
|
|
||||||
#define LWIP_HDR_AUTOIP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
/* #include "lwip/udp.h" */
|
|
||||||
#include "lwip/etharp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** AutoIP Timing */
|
|
||||||
#define AUTOIP_TMR_INTERVAL 100
|
|
||||||
#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL)
|
|
||||||
|
|
||||||
/** AutoIP state information per netif */
|
|
||||||
struct autoip
|
|
||||||
{
|
|
||||||
/** the currently selected, probed, announced or used LL IP-Address */
|
|
||||||
ip4_addr_t llipaddr;
|
|
||||||
/** current AutoIP state machine state */
|
|
||||||
u8_t state;
|
|
||||||
/** sent number of probes or announces, dependent on state */
|
|
||||||
u8_t sent_num;
|
|
||||||
/** ticks to wait, tick is AUTOIP_TMR_INTERVAL long */
|
|
||||||
u16_t ttw;
|
|
||||||
/** ticks until a conflict can be solved by defending */
|
|
||||||
u8_t lastconflict;
|
|
||||||
/** total number of probed/used Link Local IP-Addresses */
|
|
||||||
u8_t tried_llipaddr;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void autoip_set_struct(struct netif *netif, struct autoip *autoip);
|
|
||||||
/** Remove a struct autoip previously set to the netif using autoip_set_struct() */
|
|
||||||
#define autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0)
|
|
||||||
err_t autoip_start(struct netif *netif);
|
|
||||||
err_t autoip_stop(struct netif *netif);
|
|
||||||
void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr);
|
|
||||||
void autoip_tmr(void);
|
|
||||||
void autoip_network_changed(struct netif *netif);
|
|
||||||
u8_t autoip_supplied_address(const struct netif *netif);
|
|
||||||
|
|
||||||
/* for lwIP internal use by ip4.c */
|
|
||||||
u8_t autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr);
|
|
||||||
|
|
||||||
#define netif_autoip_data(netif) ((struct autoip*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_AUTOIP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_AUTOIP_H */
|
|
||||||
-159
@@ -1,159 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Debug messages infrastructure
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_DEBUG_H
|
|
||||||
#define LWIP_HDR_DEBUG_H
|
|
||||||
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup debugging_levels LWIP_DBG_MIN_LEVEL and LWIP_DBG_TYPES_ON values
|
|
||||||
* @ingroup lwip_opts_debugmsg
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @name Debug level (LWIP_DBG_MIN_LEVEL)
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
/** Debug level: ALL messages*/
|
|
||||||
#define LWIP_DBG_LEVEL_ALL 0x00
|
|
||||||
/** Debug level: Warnings. bad checksums, dropped packets, ... */
|
|
||||||
#define LWIP_DBG_LEVEL_WARNING 0x01
|
|
||||||
/** Debug level: Serious. memory allocation failures, ... */
|
|
||||||
#define LWIP_DBG_LEVEL_SERIOUS 0x02
|
|
||||||
/** Debug level: Severe */
|
|
||||||
#define LWIP_DBG_LEVEL_SEVERE 0x03
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LWIP_DBG_MASK_LEVEL 0x03
|
|
||||||
/* compatibility define only */
|
|
||||||
#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL
|
|
||||||
|
|
||||||
/** @name Enable/disable debug messages completely (LWIP_DBG_TYPES_ON)
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
/** flag for LWIP_DEBUGF to enable that debug message */
|
|
||||||
#define LWIP_DBG_ON 0x80U
|
|
||||||
/** flag for LWIP_DEBUGF to disable that debug message */
|
|
||||||
#define LWIP_DBG_OFF 0x00U
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @name Debug message types (LWIP_DBG_TYPES_ON)
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
|
|
||||||
#define LWIP_DBG_TRACE 0x40U
|
|
||||||
/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */
|
|
||||||
#define LWIP_DBG_STATE 0x20U
|
|
||||||
/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */
|
|
||||||
#define LWIP_DBG_FRESH 0x10U
|
|
||||||
/** flag for LWIP_DEBUGF to halt after printing this debug message */
|
|
||||||
#define LWIP_DBG_HALT 0x08U
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup lwip_assertions Assertion handling
|
|
||||||
* @ingroup lwip_opts_debug
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* LWIP_NOASSERT: Disable LWIP_ASSERT checks:
|
|
||||||
* To disable assertions define LWIP_NOASSERT in arch/cc.h.
|
|
||||||
*/
|
|
||||||
#ifdef __DOXYGEN__
|
|
||||||
#define LWIP_NOASSERT
|
|
||||||
#undef LWIP_NOASSERT
|
|
||||||
#endif
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_NOASSERT
|
|
||||||
#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
|
|
||||||
LWIP_PLATFORM_ASSERT(message); }} while(0)
|
|
||||||
#else /* LWIP_NOASSERT */
|
|
||||||
#define LWIP_ASSERT(message, assertion)
|
|
||||||
#endif /* LWIP_NOASSERT */
|
|
||||||
|
|
||||||
#ifndef LWIP_ERROR
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_DIAG((message))
|
|
||||||
#else
|
|
||||||
#define LWIP_PLATFORM_ERROR(message)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* if "expression" isn't true, then print "message" and execute "handler" expression */
|
|
||||||
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
|
||||||
LWIP_PLATFORM_ERROR(message); handler;}} while(0)
|
|
||||||
#endif /* LWIP_ERROR */
|
|
||||||
|
|
||||||
/** Enable debug message printing, but only if debug message type is enabled
|
|
||||||
* AND is of correct type AND is at least LWIP_DBG_LEVEL.
|
|
||||||
*/
|
|
||||||
#ifdef __DOXYGEN__
|
|
||||||
#define LWIP_DEBUG
|
|
||||||
#undef LWIP_DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
#define LWIP_DEBUGF(debug, message) do { \
|
|
||||||
if ( \
|
|
||||||
((debug) & LWIP_DBG_ON) && \
|
|
||||||
((debug) & LWIP_DBG_TYPES_ON) && \
|
|
||||||
((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
|
|
||||||
LWIP_PLATFORM_DIAG(message); \
|
|
||||||
if ((debug) & LWIP_DBG_HALT) { \
|
|
||||||
while(1); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#else /* LWIP_DEBUG */
|
|
||||||
#define LWIP_DEBUGF(debug, message)
|
|
||||||
#endif /* LWIP_DEBUG */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_DEBUG_H */
|
|
||||||
-152
@@ -1,152 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* various utility macros
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup perf Performance measurement
|
|
||||||
* @ingroup sys_layer
|
|
||||||
* All defines related to this section must not be placed in lwipopts.h,
|
|
||||||
* but in arch/perf.h!
|
|
||||||
* Measurement calls made throughout lwip, these can be defined to nothing.
|
|
||||||
* - PERF_START: start measuring something.
|
|
||||||
* - PERF_STOP(x): stop measuring something, and record the result.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_DEF_H
|
|
||||||
#define LWIP_HDR_DEF_H
|
|
||||||
|
|
||||||
/* arch.h might define NULL already */
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#if LWIP_PERF
|
|
||||||
#include "arch/perf.h"
|
|
||||||
#else /* LWIP_PERF */
|
|
||||||
#define PERF_START /* null definition */
|
|
||||||
#define PERF_STOP(x) /* null definition */
|
|
||||||
#endif /* LWIP_PERF */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y))
|
|
||||||
#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y))
|
|
||||||
|
|
||||||
/* Get the number of entries in an array ('x' must NOT be a pointer!) */
|
|
||||||
#define LWIP_ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
|
|
||||||
|
|
||||||
/** Create u32_t value from bytes */
|
|
||||||
#define LWIP_MAKEU32(a,b,c,d) (((u32_t)((a) & 0xff) << 24) | \
|
|
||||||
((u32_t)((b) & 0xff) << 16) | \
|
|
||||||
((u32_t)((c) & 0xff) << 8) | \
|
|
||||||
(u32_t)((d) & 0xff))
|
|
||||||
|
|
||||||
#ifndef NULL
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define NULL 0
|
|
||||||
#else
|
|
||||||
#define NULL ((void *)0)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
|
||||||
#define lwip_htons(x) ((u16_t)(x))
|
|
||||||
#define lwip_ntohs(x) ((u16_t)(x))
|
|
||||||
#define lwip_htonl(x) ((u32_t)(x))
|
|
||||||
#define lwip_ntohl(x) ((u32_t)(x))
|
|
||||||
#define PP_HTONS(x) ((u16_t)(x))
|
|
||||||
#define PP_NTOHS(x) ((u16_t)(x))
|
|
||||||
#define PP_HTONL(x) ((u32_t)(x))
|
|
||||||
#define PP_NTOHL(x) ((u32_t)(x))
|
|
||||||
#else /* BYTE_ORDER != BIG_ENDIAN */
|
|
||||||
#ifndef lwip_htons
|
|
||||||
u16_t lwip_htons(u16_t x);
|
|
||||||
#endif
|
|
||||||
#define lwip_ntohs(x) lwip_htons(x)
|
|
||||||
|
|
||||||
#ifndef lwip_htonl
|
|
||||||
u32_t lwip_htonl(u32_t x);
|
|
||||||
#endif
|
|
||||||
#define lwip_ntohl(x) lwip_htonl(x)
|
|
||||||
|
|
||||||
/* These macros should be calculated by the preprocessor and are used
|
|
||||||
with compile-time constants only (so that there is no little-endian
|
|
||||||
overhead at runtime). */
|
|
||||||
#define PP_HTONS(x) ((u16_t)((((x) & (u16_t)0x00ffU) << 8) | (((x) & (u16_t)0xff00U) >> 8)))
|
|
||||||
#define PP_NTOHS(x) PP_HTONS(x)
|
|
||||||
#define PP_HTONL(x) ((((x) & (u32_t)0x000000ffUL) << 24) | \
|
|
||||||
(((x) & (u32_t)0x0000ff00UL) << 8) | \
|
|
||||||
(((x) & (u32_t)0x00ff0000UL) >> 8) | \
|
|
||||||
(((x) & (u32_t)0xff000000UL) >> 24))
|
|
||||||
#define PP_NTOHL(x) PP_HTONL(x)
|
|
||||||
#endif /* BYTE_ORDER == BIG_ENDIAN */
|
|
||||||
|
|
||||||
/* Provide usual function names as macros for users, but this can be turned off */
|
|
||||||
#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
|
|
||||||
#define htons(x) lwip_htons(x)
|
|
||||||
#define ntohs(x) lwip_ntohs(x)
|
|
||||||
#define htonl(x) lwip_htonl(x)
|
|
||||||
#define ntohl(x) lwip_ntohl(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Functions that are not available as standard implementations.
|
|
||||||
* In cc.h, you can #define these to implementations available on
|
|
||||||
* your platform to save some code bytes if you use these functions
|
|
||||||
* in your application, too.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef lwip_itoa
|
|
||||||
/* This can be #defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform */
|
|
||||||
void lwip_itoa(char* result, size_t bufsize, int number);
|
|
||||||
#endif
|
|
||||||
#ifndef lwip_strnicmp
|
|
||||||
/* This can be #defined to strnicmp() or strncasecmp() depending on your platform */
|
|
||||||
int lwip_strnicmp(const char* str1, const char* str2, size_t len);
|
|
||||||
#endif
|
|
||||||
#ifndef lwip_stricmp
|
|
||||||
/* This can be #defined to stricmp() or strcasecmp() depending on your platform */
|
|
||||||
int lwip_stricmp(const char* str1, const char* str2);
|
|
||||||
#endif
|
|
||||||
#ifndef lwip_strnstr
|
|
||||||
/* This can be #defined to strnstr() depending on your platform */
|
|
||||||
char* lwip_strnstr(const char* buffer, const char* token, size_t n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_DEF_H */
|
|
||||||
-139
@@ -1,139 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* DHCP client API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Leon Woestenberg <leon.woestenberg@gmx.net>
|
|
||||||
* Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Leon Woestenberg <leon.woestenberg@gmx.net>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_DHCP_H
|
|
||||||
#define LWIP_HDR_DHCP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/udp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** period (in seconds) of the application calling dhcp_coarse_tmr() */
|
|
||||||
#define DHCP_COARSE_TIMER_SECS 60
|
|
||||||
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */
|
|
||||||
#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
|
|
||||||
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */
|
|
||||||
#define DHCP_FINE_TIMER_MSECS 500
|
|
||||||
|
|
||||||
#define DHCP_BOOT_FILE_LEN 128U
|
|
||||||
|
|
||||||
/* AutoIP cooperation flags (struct dhcp.autoip_coop_state) */
|
|
||||||
typedef enum {
|
|
||||||
DHCP_AUTOIP_COOP_STATE_OFF = 0,
|
|
||||||
DHCP_AUTOIP_COOP_STATE_ON = 1
|
|
||||||
} dhcp_autoip_coop_state_enum_t;
|
|
||||||
|
|
||||||
struct dhcp
|
|
||||||
{
|
|
||||||
/** transaction identifier of last sent request */
|
|
||||||
u32_t xid;
|
|
||||||
/** track PCB allocation state */
|
|
||||||
u8_t pcb_allocated;
|
|
||||||
/** current DHCP state machine state */
|
|
||||||
u8_t state;
|
|
||||||
/** retries of current request */
|
|
||||||
u8_t tries;
|
|
||||||
#if LWIP_DHCP_AUTOIP_COOP
|
|
||||||
u8_t autoip_coop_state;
|
|
||||||
#endif
|
|
||||||
u8_t subnet_mask_given;
|
|
||||||
|
|
||||||
u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */
|
|
||||||
u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */
|
|
||||||
u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */
|
|
||||||
u16_t t1_renew_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next renew try */
|
|
||||||
u16_t t2_rebind_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next rebind try */
|
|
||||||
u16_t lease_used; /* #ticks with period DHCP_COARSE_TIMER_SECS since last received DHCP ack */
|
|
||||||
u16_t t0_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for lease time */
|
|
||||||
ip_addr_t server_ip_addr; /* dhcp server address that offered this lease (ip_addr_t because passed to UDP) */
|
|
||||||
ip4_addr_t offered_ip_addr;
|
|
||||||
ip4_addr_t offered_sn_mask;
|
|
||||||
ip4_addr_t offered_gw_addr;
|
|
||||||
|
|
||||||
u32_t offered_t0_lease; /* lease period (in seconds) */
|
|
||||||
u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */
|
|
||||||
u32_t offered_t2_rebind; /* recommended rebind time (usually 87.5 of lease period) */
|
|
||||||
#if LWIP_DHCP_BOOTP_FILE
|
|
||||||
ip4_addr_t offered_si_addr;
|
|
||||||
char boot_file_name[DHCP_BOOT_FILE_LEN];
|
|
||||||
#endif /* LWIP_DHCP_BOOTPFILE */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp);
|
|
||||||
/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */
|
|
||||||
#define dhcp_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)
|
|
||||||
void dhcp_cleanup(struct netif *netif);
|
|
||||||
err_t dhcp_start(struct netif *netif);
|
|
||||||
err_t dhcp_renew(struct netif *netif);
|
|
||||||
err_t dhcp_release(struct netif *netif);
|
|
||||||
void dhcp_stop(struct netif *netif);
|
|
||||||
void dhcp_release_and_stop(struct netif *netif);
|
|
||||||
void dhcp_inform(struct netif *netif);
|
|
||||||
void dhcp_network_changed(struct netif *netif);
|
|
||||||
#if DHCP_DOES_ARP_CHECK
|
|
||||||
void dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr);
|
|
||||||
#endif
|
|
||||||
u8_t dhcp_supplied_address(const struct netif *netif);
|
|
||||||
/* to be called every minute */
|
|
||||||
void dhcp_coarse_tmr(void);
|
|
||||||
/* to be called every half second */
|
|
||||||
void dhcp_fine_tmr(void);
|
|
||||||
|
|
||||||
#if LWIP_DHCP_GET_NTP_SRV
|
|
||||||
/** This function must exist, in other to add offered NTP servers to
|
|
||||||
* the NTP (or SNTP) engine.
|
|
||||||
* See LWIP_DHCP_MAX_NTP_SERVERS */
|
|
||||||
extern void dhcp_set_ntp_servers(u8_t num_ntp_servers, const ip4_addr_t* ntp_server_addrs);
|
|
||||||
#endif /* LWIP_DHCP_GET_NTP_SRV */
|
|
||||||
|
|
||||||
#define netif_dhcp_data(netif) ((struct dhcp*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_DHCP */
|
|
||||||
|
|
||||||
#endif /*LWIP_HDR_DHCP_H*/
|
|
||||||
-104
@@ -1,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* DHCPv6 client: IPv6 address autoconfiguration as per
|
|
||||||
* RFC 3315 (stateful DHCPv6) and
|
|
||||||
* RFC 3736 (stateless DHCPv6).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_IP6_DHCP6_H
|
|
||||||
#define LWIP_HDR_IP6_DHCP6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** period (in milliseconds) of the application calling dhcp6_tmr() */
|
|
||||||
#define DHCP6_TIMER_MSECS 500
|
|
||||||
|
|
||||||
struct dhcp6
|
|
||||||
{
|
|
||||||
/** transaction identifier of last sent request */
|
|
||||||
u32_t xid;
|
|
||||||
/** track PCB allocation state */
|
|
||||||
u8_t pcb_allocated;
|
|
||||||
/** current DHCPv6 state machine state */
|
|
||||||
u8_t state;
|
|
||||||
/** retries of current request */
|
|
||||||
u8_t tries;
|
|
||||||
/** if request config is triggered while another action is active, this keeps track of it */
|
|
||||||
u8_t request_config_pending;
|
|
||||||
/** #ticks with period DHCP6_TIMER_MSECS for request timeout */
|
|
||||||
u16_t request_timeout;
|
|
||||||
#if LWIP_IPV6_DHCP6_STATEFUL
|
|
||||||
/* @todo: add more members here to keep track of stateful DHCPv6 data, like lease times */
|
|
||||||
#endif /* LWIP_IPV6_DHCP6_STATEFUL */
|
|
||||||
};
|
|
||||||
|
|
||||||
void dhcp6_set_struct(struct netif *netif, struct dhcp6 *dhcp6);
|
|
||||||
/** Remove a struct dhcp6 previously set to the netif using dhcp6_set_struct() */
|
|
||||||
#define dhcp6_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6, NULL)
|
|
||||||
void dhcp6_cleanup(struct netif *netif);
|
|
||||||
|
|
||||||
err_t dhcp6_enable_stateful(struct netif *netif);
|
|
||||||
err_t dhcp6_enable_stateless(struct netif *netif);
|
|
||||||
void dhcp6_disable(struct netif *netif);
|
|
||||||
|
|
||||||
void dhcp6_tmr(void);
|
|
||||||
|
|
||||||
void dhcp6_nd6_ra_trigger(struct netif *netif, u8_t managed_addr_config, u8_t other_config);
|
|
||||||
|
|
||||||
#if LWIP_DHCP6_GET_NTP_SRV
|
|
||||||
/** This function must exist, in other to add offered NTP servers to
|
|
||||||
* the NTP (or SNTP) engine.
|
|
||||||
* See LWIP_DHCP6_MAX_NTP_SERVERS */
|
|
||||||
extern void dhcp6_set_ntp_servers(u8_t num_ntp_servers, const ip_addr_t* ntp_server_addrs);
|
|
||||||
#endif /* LWIP_DHCP6_GET_NTP_SRV */
|
|
||||||
|
|
||||||
#define netif_dhcp6_data(netif) ((struct dhcp6*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6_DHCP6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP6_DHCP6_H */
|
|
||||||
-131
@@ -1,131 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* DNS API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lwip DNS resolver header file.
|
|
||||||
|
|
||||||
* Author: Jim Pettinato
|
|
||||||
* April 2007
|
|
||||||
|
|
||||||
* ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote
|
|
||||||
* products derived from this software without specific prior
|
|
||||||
* written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
|
||||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_DNS_H
|
|
||||||
#define LWIP_HDR_DNS_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_DNS
|
|
||||||
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** DNS timer period */
|
|
||||||
#define DNS_TMR_INTERVAL 1000
|
|
||||||
|
|
||||||
/* DNS resolve types: */
|
|
||||||
#define LWIP_DNS_ADDRTYPE_IPV4 0
|
|
||||||
#define LWIP_DNS_ADDRTYPE_IPV6 1
|
|
||||||
#define LWIP_DNS_ADDRTYPE_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */
|
|
||||||
#define LWIP_DNS_ADDRTYPE_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
#ifndef LWIP_DNS_ADDRTYPE_DEFAULT
|
|
||||||
#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4_IPV6
|
|
||||||
#endif
|
|
||||||
#elif LWIP_IPV4
|
|
||||||
#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4
|
|
||||||
#else
|
|
||||||
#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV6
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DNS_LOCAL_HOSTLIST
|
|
||||||
/** struct used for local host-list */
|
|
||||||
struct local_hostlist_entry {
|
|
||||||
/** static hostname */
|
|
||||||
const char *name;
|
|
||||||
/** static host address in network byteorder */
|
|
||||||
ip_addr_t addr;
|
|
||||||
struct local_hostlist_entry *next;
|
|
||||||
};
|
|
||||||
#define DNS_LOCAL_HOSTLIST_ELEM(name, addr_init) {name, addr_init, NULL}
|
|
||||||
#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
|
||||||
#ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN
|
|
||||||
#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH
|
|
||||||
#endif
|
|
||||||
#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1))
|
|
||||||
#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
|
||||||
#endif /* DNS_LOCAL_HOSTLIST */
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
extern const ip_addr_t dns_mquery_v4group;
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#if LWIP_IPV6
|
|
||||||
extern const ip_addr_t dns_mquery_v6group;
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Callback which is invoked when a hostname is found.
|
|
||||||
* A function of this type must be implemented by the application using the DNS resolver.
|
|
||||||
* @param name pointer to the name that was looked up.
|
|
||||||
* @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname,
|
|
||||||
* or NULL if the name could not be found (or on any other error).
|
|
||||||
* @param callback_arg a user-specified callback argument passed to dns_gethostbyname
|
|
||||||
*/
|
|
||||||
typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg);
|
|
||||||
|
|
||||||
void dns_init(void);
|
|
||||||
void dns_tmr(void);
|
|
||||||
void dns_setserver(u8_t numdns, const ip_addr_t *dnsserver);
|
|
||||||
const ip_addr_t* dns_getserver(u8_t numdns);
|
|
||||||
err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr,
|
|
||||||
dns_found_callback found, void *callback_arg);
|
|
||||||
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
|
||||||
dns_found_callback found, void *callback_arg,
|
|
||||||
u8_t dns_addrtype);
|
|
||||||
|
|
||||||
|
|
||||||
#if DNS_LOCAL_HOSTLIST
|
|
||||||
size_t dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg);
|
|
||||||
err_t dns_local_lookup(const char *hostname, ip_addr_t *addr, u8_t dns_addrtype);
|
|
||||||
#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
|
||||||
int dns_local_removehost(const char *hostname, const ip_addr_t *addr);
|
|
||||||
err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr);
|
|
||||||
#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
|
||||||
#endif /* DNS_LOCAL_HOSTLIST */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_DNS */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_DNS_H */
|
|
||||||
-117
@@ -1,117 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP Error codes
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ERR_H
|
|
||||||
#define LWIP_HDR_ERR_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup infrastructure_errors Error codes
|
|
||||||
* @ingroup infrastructure
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Definitions for error constants. */
|
|
||||||
typedef enum {
|
|
||||||
/** No error, everything OK. */
|
|
||||||
ERR_OK = 0,
|
|
||||||
/** Out of memory error. */
|
|
||||||
ERR_MEM = -1,
|
|
||||||
/** Buffer error. */
|
|
||||||
ERR_BUF = -2,
|
|
||||||
/** Timeout. */
|
|
||||||
ERR_TIMEOUT = -3,
|
|
||||||
/** Routing problem. */
|
|
||||||
ERR_RTE = -4,
|
|
||||||
/** Operation in progress */
|
|
||||||
ERR_INPROGRESS = -5,
|
|
||||||
/** Illegal value. */
|
|
||||||
ERR_VAL = -6,
|
|
||||||
/** Operation would block. */
|
|
||||||
ERR_WOULDBLOCK = -7,
|
|
||||||
/** Address in use. */
|
|
||||||
ERR_USE = -8,
|
|
||||||
/** Already connecting. */
|
|
||||||
ERR_ALREADY = -9,
|
|
||||||
/** Conn already established.*/
|
|
||||||
ERR_ISCONN = -10,
|
|
||||||
/** Not connected. */
|
|
||||||
ERR_CONN = -11,
|
|
||||||
/** Low-level netif error */
|
|
||||||
ERR_IF = -12,
|
|
||||||
|
|
||||||
/** Connection aborted. */
|
|
||||||
ERR_ABRT = -13,
|
|
||||||
/** Connection reset. */
|
|
||||||
ERR_RST = -14,
|
|
||||||
/** Connection closed. */
|
|
||||||
ERR_CLSD = -15,
|
|
||||||
/** Illegal argument. */
|
|
||||||
ERR_ARG = -16
|
|
||||||
} err_enum_t;
|
|
||||||
|
|
||||||
/** Define LWIP_ERR_T in cc.h if you want to use
|
|
||||||
* a different type for your platform (must be signed). */
|
|
||||||
#ifdef LWIP_ERR_T
|
|
||||||
typedef LWIP_ERR_T err_t;
|
|
||||||
#else /* LWIP_ERR_T */
|
|
||||||
typedef s8_t err_t;
|
|
||||||
#endif /* LWIP_ERR_T*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
extern const char *lwip_strerr(err_t err);
|
|
||||||
#else
|
|
||||||
#define lwip_strerr(x) ""
|
|
||||||
#endif /* LWIP_DEBUG */
|
|
||||||
|
|
||||||
#if !NO_SYS
|
|
||||||
int err_to_errno(err_t err);
|
|
||||||
#endif /* !NO_SYS */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ERR_H */
|
|
||||||
-198
@@ -1,198 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Posix Errno defines
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ERRNO_H
|
|
||||||
#define LWIP_HDR_ERRNO_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LWIP_PROVIDE_ERRNO
|
|
||||||
|
|
||||||
#define EPERM 1 /* Operation not permitted */
|
|
||||||
#define ENOENT 2 /* No such file or directory */
|
|
||||||
#define ESRCH 3 /* No such process */
|
|
||||||
#define EINTR 4 /* Interrupted system call */
|
|
||||||
#define EIO 5 /* I/O error */
|
|
||||||
#define ENXIO 6 /* No such device or address */
|
|
||||||
#define E2BIG 7 /* Arg list too long */
|
|
||||||
#define ENOEXEC 8 /* Exec format error */
|
|
||||||
#define EBADF 9 /* Bad file number */
|
|
||||||
#define ECHILD 10 /* No child processes */
|
|
||||||
#define EAGAIN 11 /* Try again */
|
|
||||||
#define ENOMEM 12 /* Out of memory */
|
|
||||||
#define EACCES 13 /* Permission denied */
|
|
||||||
#define EFAULT 14 /* Bad address */
|
|
||||||
#define ENOTBLK 15 /* Block device required */
|
|
||||||
#define EBUSY 16 /* Device or resource busy */
|
|
||||||
#define EEXIST 17 /* File exists */
|
|
||||||
#define EXDEV 18 /* Cross-device link */
|
|
||||||
#define ENODEV 19 /* No such device */
|
|
||||||
#define ENOTDIR 20 /* Not a directory */
|
|
||||||
#define EISDIR 21 /* Is a directory */
|
|
||||||
#define EINVAL 22 /* Invalid argument */
|
|
||||||
#define ENFILE 23 /* File table overflow */
|
|
||||||
#define EMFILE 24 /* Too many open files */
|
|
||||||
#define ENOTTY 25 /* Not a typewriter */
|
|
||||||
#define ETXTBSY 26 /* Text file busy */
|
|
||||||
#define EFBIG 27 /* File too large */
|
|
||||||
#define ENOSPC 28 /* No space left on device */
|
|
||||||
#define ESPIPE 29 /* Illegal seek */
|
|
||||||
#define EROFS 30 /* Read-only file system */
|
|
||||||
#define EMLINK 31 /* Too many links */
|
|
||||||
#define EPIPE 32 /* Broken pipe */
|
|
||||||
#define EDOM 33 /* Math argument out of domain of func */
|
|
||||||
#define ERANGE 34 /* Math result not representable */
|
|
||||||
#define EDEADLK 35 /* Resource deadlock would occur */
|
|
||||||
#define ENAMETOOLONG 36 /* File name too long */
|
|
||||||
#define ENOLCK 37 /* No record locks available */
|
|
||||||
#define ENOSYS 38 /* Function not implemented */
|
|
||||||
#define ENOTEMPTY 39 /* Directory not empty */
|
|
||||||
#define ELOOP 40 /* Too many symbolic links encountered */
|
|
||||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
|
||||||
#define ENOMSG 42 /* No message of desired type */
|
|
||||||
#define EIDRM 43 /* Identifier removed */
|
|
||||||
#define ECHRNG 44 /* Channel number out of range */
|
|
||||||
#define EL2NSYNC 45 /* Level 2 not synchronized */
|
|
||||||
#define EL3HLT 46 /* Level 3 halted */
|
|
||||||
#define EL3RST 47 /* Level 3 reset */
|
|
||||||
#define ELNRNG 48 /* Link number out of range */
|
|
||||||
#define EUNATCH 49 /* Protocol driver not attached */
|
|
||||||
#define ENOCSI 50 /* No CSI structure available */
|
|
||||||
#define EL2HLT 51 /* Level 2 halted */
|
|
||||||
#define EBADE 52 /* Invalid exchange */
|
|
||||||
#define EBADR 53 /* Invalid request descriptor */
|
|
||||||
#define EXFULL 54 /* Exchange full */
|
|
||||||
#define ENOANO 55 /* No anode */
|
|
||||||
#define EBADRQC 56 /* Invalid request code */
|
|
||||||
#define EBADSLT 57 /* Invalid slot */
|
|
||||||
|
|
||||||
#define EDEADLOCK EDEADLK
|
|
||||||
|
|
||||||
#define EBFONT 59 /* Bad font file format */
|
|
||||||
#define ENOSTR 60 /* Device not a stream */
|
|
||||||
#define ENODATA 61 /* No data available */
|
|
||||||
#define ETIME 62 /* Timer expired */
|
|
||||||
#define ENOSR 63 /* Out of streams resources */
|
|
||||||
#define ENONET 64 /* Machine is not on the network */
|
|
||||||
#define ENOPKG 65 /* Package not installed */
|
|
||||||
#define EREMOTE 66 /* Object is remote */
|
|
||||||
#define ENOLINK 67 /* Link has been severed */
|
|
||||||
#define EADV 68 /* Advertise error */
|
|
||||||
#define ESRMNT 69 /* Srmount error */
|
|
||||||
#define ECOMM 70 /* Communication error on send */
|
|
||||||
#define EPROTO 71 /* Protocol error */
|
|
||||||
#define EMULTIHOP 72 /* Multihop attempted */
|
|
||||||
#define EDOTDOT 73 /* RFS specific error */
|
|
||||||
#define EBADMSG 74 /* Not a data message */
|
|
||||||
#define EOVERFLOW 75 /* Value too large for defined data type */
|
|
||||||
#define ENOTUNIQ 76 /* Name not unique on network */
|
|
||||||
#define EBADFD 77 /* File descriptor in bad state */
|
|
||||||
#define EREMCHG 78 /* Remote address changed */
|
|
||||||
#define ELIBACC 79 /* Can not access a needed shared library */
|
|
||||||
#define ELIBBAD 80 /* Accessing a corrupted shared library */
|
|
||||||
#define ELIBSCN 81 /* .lib section in a.out corrupted */
|
|
||||||
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
|
|
||||||
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
|
|
||||||
#define EILSEQ 84 /* Illegal byte sequence */
|
|
||||||
#define ERESTART 85 /* Interrupted system call should be restarted */
|
|
||||||
#define ESTRPIPE 86 /* Streams pipe error */
|
|
||||||
#define EUSERS 87 /* Too many users */
|
|
||||||
#define ENOTSOCK 88 /* Socket operation on non-socket */
|
|
||||||
#define EDESTADDRREQ 89 /* Destination address required */
|
|
||||||
#define EMSGSIZE 90 /* Message too long */
|
|
||||||
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
|
|
||||||
#define ENOPROTOOPT 92 /* Protocol not available */
|
|
||||||
#define EPROTONOSUPPORT 93 /* Protocol not supported */
|
|
||||||
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
|
|
||||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
|
||||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
|
||||||
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
|
|
||||||
#define EADDRINUSE 98 /* Address already in use */
|
|
||||||
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
|
|
||||||
#define ENETDOWN 100 /* Network is down */
|
|
||||||
#define ENETUNREACH 101 /* Network is unreachable */
|
|
||||||
#define ENETRESET 102 /* Network dropped connection because of reset */
|
|
||||||
#define ECONNABORTED 103 /* Software caused connection abort */
|
|
||||||
#define ECONNRESET 104 /* Connection reset by peer */
|
|
||||||
#define ENOBUFS 105 /* No buffer space available */
|
|
||||||
#define EISCONN 106 /* Transport endpoint is already connected */
|
|
||||||
#define ENOTCONN 107 /* Transport endpoint is not connected */
|
|
||||||
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
|
|
||||||
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
|
|
||||||
#define ETIMEDOUT 110 /* Connection timed out */
|
|
||||||
#define ECONNREFUSED 111 /* Connection refused */
|
|
||||||
#define EHOSTDOWN 112 /* Host is down */
|
|
||||||
#define EHOSTUNREACH 113 /* No route to host */
|
|
||||||
#define EALREADY 114 /* Operation already in progress */
|
|
||||||
#define EINPROGRESS 115 /* Operation now in progress */
|
|
||||||
#define ESTALE 116 /* Stale NFS file handle */
|
|
||||||
#define EUCLEAN 117 /* Structure needs cleaning */
|
|
||||||
#define ENOTNAM 118 /* Not a XENIX named type file */
|
|
||||||
#define ENAVAIL 119 /* No XENIX semaphores available */
|
|
||||||
#define EISNAM 120 /* Is a named type file */
|
|
||||||
#define EREMOTEIO 121 /* Remote I/O error */
|
|
||||||
#define EDQUOT 122 /* Quota exceeded */
|
|
||||||
|
|
||||||
#define ENOMEDIUM 123 /* No medium found */
|
|
||||||
#define EMEDIUMTYPE 124 /* Wrong medium type */
|
|
||||||
|
|
||||||
#ifndef errno
|
|
||||||
extern int errno;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* LWIP_PROVIDE_ERRNO */
|
|
||||||
|
|
||||||
/* Define LWIP_ERRNO_STDINCLUDE if you want to include <errno.h> here */
|
|
||||||
#ifdef LWIP_ERRNO_STDINCLUDE
|
|
||||||
#include <errno.h>
|
|
||||||
#else /* LWIP_ERRNO_STDINCLUDE */
|
|
||||||
/* Define LWIP_ERRNO_INCLUDE to an equivalent of <errno.h> to include the error defines here */
|
|
||||||
#ifdef LWIP_ERRNO_INCLUDE
|
|
||||||
#include LWIP_ERRNO_INCLUDE
|
|
||||||
#endif /* LWIP_ERRNO_INCLUDE */
|
|
||||||
#endif /* LWIP_ERRNO_STDINCLUDE */
|
|
||||||
|
|
||||||
#endif /* LWIP_PROVIDE_ERRNO */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ERRNO_H */
|
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Ethernet output function - handles OUTGOING ethernet level traffic, implements
|
|
||||||
* ARP resolving.
|
|
||||||
* To be used in most low-level netif implementations
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
|
||||||
* Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
|
|
||||||
* Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_NETIF_ETHARP_H
|
|
||||||
#define LWIP_HDR_NETIF_ETHARP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ARP || LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip4_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/ip4.h"
|
|
||||||
#include "lwip/prot/ethernet.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/prot/etharp.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** 1 seconds period */
|
|
||||||
#define ARP_TMR_INTERVAL 1000
|
|
||||||
|
|
||||||
#if ARP_QUEUEING
|
|
||||||
/** struct for queueing outgoing packets for unknown address
|
|
||||||
* defined here to be accessed by memp.h
|
|
||||||
*/
|
|
||||||
struct etharp_q_entry {
|
|
||||||
struct etharp_q_entry *next;
|
|
||||||
struct pbuf *p;
|
|
||||||
};
|
|
||||||
#endif /* ARP_QUEUEING */
|
|
||||||
|
|
||||||
#define etharp_init() /* Compatibility define, no init needed. */
|
|
||||||
void etharp_tmr(void);
|
|
||||||
ssize_t etharp_find_addr(struct netif *netif, const ip4_addr_t *ipaddr,
|
|
||||||
struct eth_addr **eth_ret, const ip4_addr_t **ip_ret);
|
|
||||||
int etharp_get_entry(size_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret);
|
|
||||||
err_t etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr);
|
|
||||||
err_t etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q);
|
|
||||||
err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr);
|
|
||||||
/** For Ethernet network interfaces, we might want to send "gratuitous ARP";
|
|
||||||
* this is an ARP packet sent by a node in order to spontaneously cause other
|
|
||||||
* nodes to update an entry in their ARP cache.
|
|
||||||
* From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */
|
|
||||||
#define etharp_gratuitous(netif) etharp_request((netif), netif_ip4_addr(netif))
|
|
||||||
void etharp_cleanup_netif(struct netif *netif);
|
|
||||||
|
|
||||||
#if ETHARP_SUPPORT_STATIC_ENTRIES
|
|
||||||
err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr);
|
|
||||||
err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr);
|
|
||||||
#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
|
|
||||||
|
|
||||||
void etharp_input(struct pbuf *p, struct netif *netif);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_ARP */
|
|
||||||
#endif /* LWIP_ARP || LWIP_ETHERNET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETIF_ETHARP_H */
|
|
||||||
-68
@@ -1,68 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* Ethernet output for IPv6. Uses ND tables for link-layer addressing.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_ETHIP6_H
|
|
||||||
#define LWIP_HDR_ETHIP6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip6.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_ETHERNET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ETHIP6_H */
|
|
||||||
-110
@@ -1,110 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* ICMP API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ICMP_H
|
|
||||||
#define LWIP_HDR_ICMP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/prot/icmp.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_ICMP6
|
|
||||||
#include "lwip/icmp6.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** ICMP destination unreachable codes */
|
|
||||||
enum icmp_dur_type {
|
|
||||||
/** net unreachable */
|
|
||||||
ICMP_DUR_NET = 0,
|
|
||||||
/** host unreachable */
|
|
||||||
ICMP_DUR_HOST = 1,
|
|
||||||
/** protocol unreachable */
|
|
||||||
ICMP_DUR_PROTO = 2,
|
|
||||||
/** port unreachable */
|
|
||||||
ICMP_DUR_PORT = 3,
|
|
||||||
/** fragmentation needed and DF set */
|
|
||||||
ICMP_DUR_FRAG = 4,
|
|
||||||
/** source route failed */
|
|
||||||
ICMP_DUR_SR = 5
|
|
||||||
};
|
|
||||||
|
|
||||||
/** ICMP time exceeded codes */
|
|
||||||
enum icmp_te_type {
|
|
||||||
/** time to live exceeded in transit */
|
|
||||||
ICMP_TE_TTL = 0,
|
|
||||||
/** fragment reassembly time exceeded */
|
|
||||||
ICMP_TE_FRAG = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
void icmp_input(struct pbuf *p, struct netif *inp);
|
|
||||||
void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
|
|
||||||
void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_ICMP */
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
#if LWIP_ICMP && LWIP_ICMP6
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf) ((isipv6) ? \
|
|
||||||
icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) : \
|
|
||||||
icmp_dest_unreach(pbuf, ICMP_DUR_PORT))
|
|
||||||
#elif LWIP_ICMP
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf) do{ if(!(isipv6)) { icmp_dest_unreach(pbuf, ICMP_DUR_PORT);}}while(0)
|
|
||||||
#elif LWIP_ICMP6
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf) do{ if(isipv6) { icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT);}}while(0)
|
|
||||||
#else
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf)
|
|
||||||
#endif
|
|
||||||
#elif LWIP_IPV6 && LWIP_ICMP6
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf) icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT)
|
|
||||||
#elif LWIP_IPV4 && LWIP_ICMP
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf) icmp_dest_unreach(pbuf, ICMP_DUR_PORT)
|
|
||||||
#else /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) */
|
|
||||||
#define icmp_port_unreach(isipv6, pbuf)
|
|
||||||
#endif /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) LWIP_IPV4*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ICMP_H */
|
|
||||||
-72
@@ -1,72 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* IPv6 version of ICMP, as per RFC 4443.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ICMP6_H
|
|
||||||
#define LWIP_HDR_ICMP6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/prot/icmp6.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_ICMP6 && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
void icmp6_input(struct pbuf *p, struct netif *inp);
|
|
||||||
void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c);
|
|
||||||
void icmp6_packet_too_big(struct pbuf *p, u32_t mtu);
|
|
||||||
void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c);
|
|
||||||
void icmp6_time_exceeded_with_addrs(struct pbuf *p, enum icmp6_te_code c,
|
|
||||||
const ip6_addr_t *src_addr, const ip6_addr_t *dest_addr);
|
|
||||||
void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, const void *pointer);
|
|
||||||
|
|
||||||
#endif /* LWIP_ICMP6 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ICMP6_H */
|
|
||||||
-70
@@ -1,70 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Interface Identification APIs from:
|
|
||||||
* RFC 3493: Basic Socket Interface Extensions for IPv6
|
|
||||||
* Section 4: Interface Identification
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Joel Cunningham <joel.cunningham@me.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IF_H
|
|
||||||
#define LWIP_HDR_IF_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef IF_NAMESIZE
|
|
||||||
#define IF_NAMESIZE NETIF_NAMESIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char * lwip_if_indextoname(unsigned int ifindex, char *ifname);
|
|
||||||
unsigned int lwip_if_nametoindex(const char *ifname);
|
|
||||||
|
|
||||||
#if LWIP_COMPAT_SOCKETS
|
|
||||||
#define if_indextoname(ifindex, ifname) lwip_if_indextoname(ifindex,ifname)
|
|
||||||
#define if_nametoindex(ifname) lwip_if_nametoindex(ifname)
|
|
||||||
#endif /* LWIP_COMPAT_SOCKETS */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_SOCKET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IF_H */
|
|
||||||
-115
@@ -1,115 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IGMP API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2002 CITEL Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is a contribution to the lwIP TCP/IP stack.
|
|
||||||
* The Swedish Institute of Computer Science and Adam Dunkels
|
|
||||||
* are specifically granted permission to redistribute this
|
|
||||||
* source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_IGMP_H
|
|
||||||
#define LWIP_HDR_IGMP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* IGMP timer */
|
|
||||||
#define IGMP_TMR_INTERVAL 100 /* Milliseconds */
|
|
||||||
#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL)
|
|
||||||
#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)
|
|
||||||
|
|
||||||
/* Compatibility defines (don't use for new code) */
|
|
||||||
#define IGMP_DEL_MAC_FILTER NETIF_DEL_MAC_FILTER
|
|
||||||
#define IGMP_ADD_MAC_FILTER NETIF_ADD_MAC_FILTER
|
|
||||||
|
|
||||||
/**
|
|
||||||
* igmp group structure - there is
|
|
||||||
* a list of groups for each interface
|
|
||||||
* these should really be linked from the interface, but
|
|
||||||
* if we keep them separate we will not affect the lwip original code
|
|
||||||
* too much
|
|
||||||
*
|
|
||||||
* There will be a group for the all systems group address but this
|
|
||||||
* will not run the state machine as it is used to kick off reports
|
|
||||||
* from all the other groups
|
|
||||||
*/
|
|
||||||
struct igmp_group {
|
|
||||||
/** next link */
|
|
||||||
struct igmp_group *next;
|
|
||||||
/** multicast address */
|
|
||||||
ip4_addr_t group_address;
|
|
||||||
/** signifies we were the last person to report */
|
|
||||||
u8_t last_reporter_flag;
|
|
||||||
/** current state of the group */
|
|
||||||
u8_t group_state;
|
|
||||||
/** timer for reporting, negative is OFF */
|
|
||||||
u16_t timer;
|
|
||||||
/** counter of simultaneous uses */
|
|
||||||
u8_t use;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Prototypes */
|
|
||||||
void igmp_init(void);
|
|
||||||
err_t igmp_start(struct netif *netif);
|
|
||||||
err_t igmp_stop(struct netif *netif);
|
|
||||||
void igmp_report_groups(struct netif *netif);
|
|
||||||
struct igmp_group *igmp_lookfor_group(struct netif *ifp, const ip4_addr_t *addr);
|
|
||||||
void igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest);
|
|
||||||
err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr);
|
|
||||||
err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);
|
|
||||||
err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr);
|
|
||||||
err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);
|
|
||||||
void igmp_tmr(void);
|
|
||||||
|
|
||||||
/** @ingroup igmp
|
|
||||||
* Get list head of IGMP groups for netif.
|
|
||||||
* Note: The allsystems group IP is contained in the list as first entry.
|
|
||||||
* @see @ref netif_set_igmp_mac_filter()
|
|
||||||
*/
|
|
||||||
#define netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IGMP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IGMP_H */
|
|
||||||
-169
@@ -1,169 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* This file (together with sockets.h) aims to provide structs and functions from
|
|
||||||
* - arpa/inet.h
|
|
||||||
* - netinet/in.h
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_INET_H
|
|
||||||
#define LWIP_HDR_INET_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/def.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If your port already typedef's in_addr_t, define _IN_ADDR_T_DECLARED
|
|
||||||
to prevent this code from redefining it. */
|
|
||||||
#if !defined(in_addr_t) && !defined(_IN_ADDR_T_DECLARED)
|
|
||||||
typedef u32_t in_addr_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct in_addr {
|
|
||||||
in_addr_t s_addr;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct in6_addr {
|
|
||||||
union {
|
|
||||||
u32_t u32_addr[4];
|
|
||||||
u8_t u8_addr[16];
|
|
||||||
} un;
|
|
||||||
#define s6_addr un.u8_addr
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 255.255.255.255 */
|
|
||||||
#define INADDR_NONE IPADDR_NONE
|
|
||||||
/** 127.0.0.1 */
|
|
||||||
#define INADDR_LOOPBACK IPADDR_LOOPBACK
|
|
||||||
/** 0.0.0.0 */
|
|
||||||
#define INADDR_ANY IPADDR_ANY
|
|
||||||
/** 255.255.255.255 */
|
|
||||||
#define INADDR_BROADCAST IPADDR_BROADCAST
|
|
||||||
|
|
||||||
/** This macro can be used to initialize a variable of type struct in6_addr
|
|
||||||
to the IPv6 wildcard address. */
|
|
||||||
#define IN6ADDR_ANY_INIT {{{0,0,0,0}}}
|
|
||||||
/** This macro can be used to initialize a variable of type struct in6_addr
|
|
||||||
to the IPv6 loopback address. */
|
|
||||||
#define IN6ADDR_LOOPBACK_INIT {{{0,0,0,PP_HTONL(1)}}}
|
|
||||||
/** This variable is initialized by the system to contain the wildcard IPv6 address. */
|
|
||||||
extern const struct in6_addr in6addr_any;
|
|
||||||
|
|
||||||
/* Definitions of the bits in an (IPv4) Internet address integer.
|
|
||||||
|
|
||||||
On subnets, host and network parts are found according to
|
|
||||||
the subnet mask, not these masks. */
|
|
||||||
#define IN_CLASSA(a) IP_CLASSA(a)
|
|
||||||
#define IN_CLASSA_NET IP_CLASSA_NET
|
|
||||||
#define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT
|
|
||||||
#define IN_CLASSA_HOST IP_CLASSA_HOST
|
|
||||||
#define IN_CLASSA_MAX IP_CLASSA_MAX
|
|
||||||
|
|
||||||
#define IN_CLASSB(b) IP_CLASSB(b)
|
|
||||||
#define IN_CLASSB_NET IP_CLASSB_NET
|
|
||||||
#define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT
|
|
||||||
#define IN_CLASSB_HOST IP_CLASSB_HOST
|
|
||||||
#define IN_CLASSB_MAX IP_CLASSB_MAX
|
|
||||||
|
|
||||||
#define IN_CLASSC(c) IP_CLASSC(c)
|
|
||||||
#define IN_CLASSC_NET IP_CLASSC_NET
|
|
||||||
#define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT
|
|
||||||
#define IN_CLASSC_HOST IP_CLASSC_HOST
|
|
||||||
#define IN_CLASSC_MAX IP_CLASSC_MAX
|
|
||||||
|
|
||||||
#define IN_CLASSD(d) IP_CLASSD(d)
|
|
||||||
#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */
|
|
||||||
#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */
|
|
||||||
#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */
|
|
||||||
#define IN_CLASSD_MAX IP_CLASSD_MAX
|
|
||||||
|
|
||||||
#define IN_MULTICAST(a) IP_MULTICAST(a)
|
|
||||||
|
|
||||||
#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a)
|
|
||||||
#define IN_BADCLASS(a) IP_BADCLASS(a)
|
|
||||||
|
|
||||||
#define IN_LOOPBACKNET IP_LOOPBACKNET
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef INET_ADDRSTRLEN
|
|
||||||
#define INET_ADDRSTRLEN IP4ADDR_STRLEN_MAX
|
|
||||||
#endif
|
|
||||||
#if LWIP_IPV6
|
|
||||||
#ifndef INET6_ADDRSTRLEN
|
|
||||||
#define INET6_ADDRSTRLEN IP6ADDR_STRLEN_MAX
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
#define inet_addr_from_ip4addr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr))
|
|
||||||
#define inet_addr_to_ip4addr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr))
|
|
||||||
|
|
||||||
/* directly map this to the lwip internal functions */
|
|
||||||
#define inet_addr(cp) ipaddr_addr(cp)
|
|
||||||
#define inet_aton(cp, addr) ip4addr_aton(cp, (ip4_addr_t*)addr)
|
|
||||||
#define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr))
|
|
||||||
#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
#define inet6_addr_from_ip6addr(target_in6addr, source_ip6addr) {(target_in6addr)->un.u32_addr[0] = (source_ip6addr)->addr[0]; \
|
|
||||||
(target_in6addr)->un.u32_addr[1] = (source_ip6addr)->addr[1]; \
|
|
||||||
(target_in6addr)->un.u32_addr[2] = (source_ip6addr)->addr[2]; \
|
|
||||||
(target_in6addr)->un.u32_addr[3] = (source_ip6addr)->addr[3];}
|
|
||||||
#define inet6_addr_to_ip6addr(target_ip6addr, source_in6addr) {(target_ip6addr)->addr[0] = (source_in6addr)->un.u32_addr[0]; \
|
|
||||||
(target_ip6addr)->addr[1] = (source_in6addr)->un.u32_addr[1]; \
|
|
||||||
(target_ip6addr)->addr[2] = (source_in6addr)->un.u32_addr[2]; \
|
|
||||||
(target_ip6addr)->addr[3] = (source_in6addr)->un.u32_addr[3]; \
|
|
||||||
ip6_addr_clear_zone(target_ip6addr);}
|
|
||||||
|
|
||||||
/* directly map this to the lwip internal functions */
|
|
||||||
#define inet6_aton(cp, addr) ip6addr_aton(cp, (ip6_addr_t*)addr)
|
|
||||||
#define inet6_ntoa(addr) ip6addr_ntoa((const ip6_addr_t*)&(addr))
|
|
||||||
#define inet6_ntoa_r(addr, buf, buflen) ip6addr_ntoa_r((const ip6_addr_t*)&(addr), buf, buflen)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_INET_H */
|
|
||||||
-104
@@ -1,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IP checksum calculation functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_INET_CHKSUM_H
|
|
||||||
#define LWIP_HDR_INET_CHKSUM_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
/** Swap the bytes in an u16_t: much like lwip_htons() for little-endian */
|
|
||||||
#ifndef SWAP_BYTES_IN_WORD
|
|
||||||
#define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8)
|
|
||||||
#endif /* SWAP_BYTES_IN_WORD */
|
|
||||||
|
|
||||||
/** Split an u32_t in two u16_ts and add them up */
|
|
||||||
#ifndef FOLD_U32T
|
|
||||||
#define FOLD_U32T(u) ((u32_t)(((u) >> 16) + ((u) & 0x0000ffffUL)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_CHECKSUM_ON_COPY
|
|
||||||
/** Function-like macro: same as MEMCPY but returns the checksum of copied data
|
|
||||||
as u16_t */
|
|
||||||
# ifndef LWIP_CHKSUM_COPY
|
|
||||||
# define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len)
|
|
||||||
# ifndef LWIP_CHKSUM_COPY_ALGORITHM
|
|
||||||
# define LWIP_CHKSUM_COPY_ALGORITHM 1
|
|
||||||
# endif /* LWIP_CHKSUM_COPY_ALGORITHM */
|
|
||||||
# else /* LWIP_CHKSUM_COPY */
|
|
||||||
# define LWIP_CHKSUM_COPY_ALGORITHM 0
|
|
||||||
# endif /* LWIP_CHKSUM_COPY */
|
|
||||||
#else /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
# define LWIP_CHKSUM_COPY_ALGORITHM 0
|
|
||||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
u16_t inet_chksum(const void *dataptr, u16_t len);
|
|
||||||
u16_t inet_chksum_pbuf(struct pbuf *p);
|
|
||||||
#if LWIP_CHKSUM_COPY_ALGORITHM
|
|
||||||
u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len);
|
|
||||||
#endif /* LWIP_CHKSUM_COPY_ALGORITHM */
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
u16_t inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|
||||||
const ip4_addr_t *src, const ip4_addr_t *dest);
|
|
||||||
u16_t inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto,
|
|
||||||
u16_t proto_len, u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest);
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
u16_t ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|
||||||
const ip6_addr_t *src, const ip6_addr_t *dest);
|
|
||||||
u16_t ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|
||||||
u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest);
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
|
|
||||||
u16_t ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|
||||||
const ip_addr_t *src, const ip_addr_t *dest);
|
|
||||||
u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|
||||||
u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_INET_H */
|
|
||||||
-100
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP initialization API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_INIT_H
|
|
||||||
#define LWIP_HDR_INIT_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup lwip_version Version
|
|
||||||
* @ingroup lwip
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** X.x.x: Major version of the stack */
|
|
||||||
#define LWIP_VERSION_MAJOR 2
|
|
||||||
/** x.X.x: Minor version of the stack */
|
|
||||||
#define LWIP_VERSION_MINOR 1
|
|
||||||
/** x.x.X: Revision of the stack */
|
|
||||||
#define LWIP_VERSION_REVISION 3
|
|
||||||
/** For release candidates, this is set to 1..254
|
|
||||||
* For official releases, this is set to 255 (LWIP_RC_RELEASE)
|
|
||||||
* For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */
|
|
||||||
#define LWIP_VERSION_RC LWIP_RC_RELEASE
|
|
||||||
|
|
||||||
/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */
|
|
||||||
#define LWIP_RC_RELEASE 255
|
|
||||||
/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions */
|
|
||||||
#define LWIP_RC_DEVELOPMENT 0
|
|
||||||
|
|
||||||
#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE)
|
|
||||||
#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT)
|
|
||||||
#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT))
|
|
||||||
|
|
||||||
/* Some helper defines to get a version string */
|
|
||||||
#define LWIP_VERSTR2(x) #x
|
|
||||||
#define LWIP_VERSTR(x) LWIP_VERSTR2(x)
|
|
||||||
#if LWIP_VERSION_IS_RELEASE
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX ""
|
|
||||||
#elif LWIP_VERSION_IS_DEVELOPMENT
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX "d"
|
|
||||||
#else
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX "rc" LWIP_VERSTR(LWIP_VERSION_RC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Provides the version of the stack */
|
|
||||||
#define LWIP_VERSION ((LWIP_VERSION_MAJOR) << 24 | (LWIP_VERSION_MINOR) << 16 | \
|
|
||||||
(LWIP_VERSION_REVISION) << 8 | (LWIP_VERSION_RC))
|
|
||||||
/** Provides the version of the stack as string */
|
|
||||||
#define LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Modules initialization */
|
|
||||||
void lwip_init(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_INIT_H */
|
|
||||||
-100
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP initialization API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_INIT_H
|
|
||||||
#define LWIP_HDR_INIT_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup lwip_version Version
|
|
||||||
* @ingroup lwip
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** X.x.x: Major version of the stack */
|
|
||||||
#define LWIP_VERSION_MAJOR ${LWIP_VERSION_MAJOR}
|
|
||||||
/** x.X.x: Minor version of the stack */
|
|
||||||
#define LWIP_VERSION_MINOR ${LWIP_VERSION_MINOR}
|
|
||||||
/** x.x.X: Revision of the stack */
|
|
||||||
#define LWIP_VERSION_REVISION ${LWIP_VERSION_REVISION}
|
|
||||||
/** For release candidates, this is set to 1..254
|
|
||||||
* For official releases, this is set to 255 (LWIP_RC_RELEASE)
|
|
||||||
* For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */
|
|
||||||
#define LWIP_VERSION_RC ${LWIP_VERSION_RC}
|
|
||||||
|
|
||||||
/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */
|
|
||||||
#define LWIP_RC_RELEASE 255
|
|
||||||
/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions */
|
|
||||||
#define LWIP_RC_DEVELOPMENT 0
|
|
||||||
|
|
||||||
#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE)
|
|
||||||
#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT)
|
|
||||||
#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT))
|
|
||||||
|
|
||||||
/* Some helper defines to get a version string */
|
|
||||||
#define LWIP_VERSTR2(x) #x
|
|
||||||
#define LWIP_VERSTR(x) LWIP_VERSTR2(x)
|
|
||||||
#if LWIP_VERSION_IS_RELEASE
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX ""
|
|
||||||
#elif LWIP_VERSION_IS_DEVELOPMENT
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX "d"
|
|
||||||
#else
|
|
||||||
#define LWIP_VERSION_STRING_SUFFIX "rc" LWIP_VERSTR(LWIP_VERSION_RC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Provides the version of the stack */
|
|
||||||
#define LWIP_VERSION ((LWIP_VERSION_MAJOR) << 24 | (LWIP_VERSION_MINOR) << 16 | \
|
|
||||||
(LWIP_VERSION_REVISION) << 8 | (LWIP_VERSION_RC))
|
|
||||||
/** Provides the version of the stack as string */
|
|
||||||
#define LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Modules initialization */
|
|
||||||
void lwip_init(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_INIT_H */
|
|
||||||
-328
@@ -1,328 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IP API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP_H
|
|
||||||
#define LWIP_HDR_IP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#include "lwip/def.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/ip4.h"
|
|
||||||
#include "lwip/ip6.h"
|
|
||||||
#include "lwip/prot/ip.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is passed as the destination address to ip_output_if (not
|
|
||||||
to ip_output), meaning that an IP header already is constructed
|
|
||||||
in the pbuf. This is used when TCP retransmits. */
|
|
||||||
#define LWIP_IP_HDRINCL NULL
|
|
||||||
|
|
||||||
/** pbufs passed to IP must have a ref-count of 1 as their payload pointer
|
|
||||||
gets altered as the packet is passed down the stack */
|
|
||||||
#ifndef LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX
|
|
||||||
#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p) LWIP_ASSERT("p->ref == 1", (p)->ref == 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_NETIF_USE_HINTS
|
|
||||||
#define IP_PCB_NETIFHINT ;struct netif_hint netif_hints
|
|
||||||
#else /* LWIP_NETIF_USE_HINTS */
|
|
||||||
#define IP_PCB_NETIFHINT
|
|
||||||
#endif /* LWIP_NETIF_USE_HINTS */
|
|
||||||
|
|
||||||
/** This is the common part of all PCB types. It needs to be at the
|
|
||||||
beginning of a PCB type definition. It is located here so that
|
|
||||||
changes to this common part are made in one location instead of
|
|
||||||
having to change all PCB structs. */
|
|
||||||
#define IP_PCB \
|
|
||||||
/* ip addresses in network byte order */ \
|
|
||||||
ip_addr_t local_ip; \
|
|
||||||
ip_addr_t remote_ip; \
|
|
||||||
/* Bound netif index */ \
|
|
||||||
u8_t netif_idx; \
|
|
||||||
/* Socket options */ \
|
|
||||||
u8_t so_options; \
|
|
||||||
/* Type Of Service */ \
|
|
||||||
u8_t tos; \
|
|
||||||
/* Time To Live */ \
|
|
||||||
u8_t ttl \
|
|
||||||
/* link layer address resolution hint */ \
|
|
||||||
IP_PCB_NETIFHINT
|
|
||||||
|
|
||||||
struct ip_pcb {
|
|
||||||
/* Common members of all PCB types */
|
|
||||||
IP_PCB;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Option flags per-socket. These are the same like SO_XXX in sockets.h
|
|
||||||
*/
|
|
||||||
#define SOF_REUSEADDR 0x04U /* allow local address reuse */
|
|
||||||
#define SOF_KEEPALIVE 0x08U /* keep connections alive */
|
|
||||||
#define SOF_BROADCAST 0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
|
|
||||||
|
|
||||||
/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */
|
|
||||||
#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE)
|
|
||||||
|
|
||||||
/** Global variables of this module, kept in a struct for efficient access using base+index. */
|
|
||||||
struct ip_globals
|
|
||||||
{
|
|
||||||
/** The interface that accepted the packet for the current callback invocation. */
|
|
||||||
struct netif *current_netif;
|
|
||||||
/** The interface that received the packet for the current callback invocation. */
|
|
||||||
struct netif *current_input_netif;
|
|
||||||
#if LWIP_IPV4
|
|
||||||
/** Header of the input packet currently being processed. */
|
|
||||||
const struct ip_hdr *current_ip4_header;
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** Header of the input IPv6 packet currently being processed. */
|
|
||||||
struct ip6_hdr *current_ip6_header;
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
/** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */
|
|
||||||
u16_t current_ip_header_tot_len;
|
|
||||||
/** Source IP address of current_header */
|
|
||||||
ip_addr_t current_iphdr_src;
|
|
||||||
/** Destination IP address of current_header */
|
|
||||||
ip_addr_t current_iphdr_dest;
|
|
||||||
};
|
|
||||||
extern struct ip_globals ip_data;
|
|
||||||
|
|
||||||
|
|
||||||
/** Get the interface that accepted the current packet.
|
|
||||||
* This may or may not be the receiving netif, depending on your netif/network setup.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip_current_netif() (ip_data.current_netif)
|
|
||||||
/** Get the interface that received the current packet.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip_current_input_netif() (ip_data.current_input_netif)
|
|
||||||
/** Total header length of ip(6)_current_header() (i.e. after this, the UDP/TCP header starts) */
|
|
||||||
#define ip_current_header_tot_len() (ip_data.current_ip_header_tot_len)
|
|
||||||
/** Source IP address of current_header */
|
|
||||||
#define ip_current_src_addr() (&ip_data.current_iphdr_src)
|
|
||||||
/** Destination IP address of current_header */
|
|
||||||
#define ip_current_dest_addr() (&ip_data.current_iphdr_dest)
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
/** Get the IPv4 header of the current packet.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip4_current_header() ip_data.current_ip4_header
|
|
||||||
/** Get the IPv6 header of the current packet.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header))
|
|
||||||
/** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */
|
|
||||||
#define ip_current_is_v6() (ip6_current_header() != NULL)
|
|
||||||
/** Source IPv6 address of current_header */
|
|
||||||
#define ip6_current_src_addr() (ip_2_ip6(&ip_data.current_iphdr_src))
|
|
||||||
/** Destination IPv6 address of current_header */
|
|
||||||
#define ip6_current_dest_addr() (ip_2_ip6(&ip_data.current_iphdr_dest))
|
|
||||||
/** Get the transport layer protocol */
|
|
||||||
#define ip_current_header_proto() (ip_current_is_v6() ? \
|
|
||||||
IP6H_NEXTH(ip6_current_header()) :\
|
|
||||||
IPH_PROTO(ip4_current_header()))
|
|
||||||
/** Get the transport layer header */
|
|
||||||
#define ip_next_header_ptr() ((const void*)((ip_current_is_v6() ? \
|
|
||||||
(const u8_t*)ip6_current_header() : (const u8_t*)ip4_current_header()) + ip_current_header_tot_len()))
|
|
||||||
|
|
||||||
/** Source IP4 address of current_header */
|
|
||||||
#define ip4_current_src_addr() (ip_2_ip4(&ip_data.current_iphdr_src))
|
|
||||||
/** Destination IP4 address of current_header */
|
|
||||||
#define ip4_current_dest_addr() (ip_2_ip4(&ip_data.current_iphdr_dest))
|
|
||||||
|
|
||||||
#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Get the IPv4 header of the current packet.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip4_current_header() ip_data.current_ip4_header
|
|
||||||
/** Always returns FALSE when only supporting IPv4 only */
|
|
||||||
#define ip_current_is_v6() 0
|
|
||||||
/** Get the transport layer protocol */
|
|
||||||
#define ip_current_header_proto() IPH_PROTO(ip4_current_header())
|
|
||||||
/** Get the transport layer header */
|
|
||||||
#define ip_next_header_ptr() ((const void*)((const u8_t*)ip4_current_header() + ip_current_header_tot_len()))
|
|
||||||
/** Source IP4 address of current_header */
|
|
||||||
#define ip4_current_src_addr() (&ip_data.current_iphdr_src)
|
|
||||||
/** Destination IP4 address of current_header */
|
|
||||||
#define ip4_current_dest_addr() (&ip_data.current_iphdr_dest)
|
|
||||||
|
|
||||||
#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Get the IPv6 header of the current packet.
|
|
||||||
* This function must only be called from a receive callback (udp_recv,
|
|
||||||
* raw_recv, tcp_accept). It will return NULL otherwise. */
|
|
||||||
#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header))
|
|
||||||
/** Always returns TRUE when only supporting IPv6 only */
|
|
||||||
#define ip_current_is_v6() 1
|
|
||||||
/** Get the transport layer protocol */
|
|
||||||
#define ip_current_header_proto() IP6H_NEXTH(ip6_current_header())
|
|
||||||
/** Get the transport layer header */
|
|
||||||
#define ip_next_header_ptr() ((const void*)(((const u8_t*)ip6_current_header()) + ip_current_header_tot_len()))
|
|
||||||
/** Source IP6 address of current_header */
|
|
||||||
#define ip6_current_src_addr() (&ip_data.current_iphdr_src)
|
|
||||||
/** Destination IP6 address of current_header */
|
|
||||||
#define ip6_current_dest_addr() (&ip_data.current_iphdr_dest)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Union source address of current_header */
|
|
||||||
#define ip_current_src_addr() (&ip_data.current_iphdr_src)
|
|
||||||
/** Union destination address of current_header */
|
|
||||||
#define ip_current_dest_addr() (&ip_data.current_iphdr_dest)
|
|
||||||
|
|
||||||
/** Gets an IP pcb option (SOF_* flags) */
|
|
||||||
#define ip_get_option(pcb, opt) ((pcb)->so_options & (opt))
|
|
||||||
/** Sets an IP pcb option (SOF_* flags) */
|
|
||||||
#define ip_set_option(pcb, opt) ((pcb)->so_options = (u8_t)((pcb)->so_options | (opt)))
|
|
||||||
/** Resets an IP pcb option (SOF_* flags) */
|
|
||||||
#define ip_reset_option(pcb, opt) ((pcb)->so_options = (u8_t)((pcb)->so_options & ~(opt)))
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
/**
|
|
||||||
* @ingroup ip
|
|
||||||
* Output IP packet, netif is selected by source address
|
|
||||||
*/
|
|
||||||
#define ip_output(p, src, dest, ttl, tos, proto) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \
|
|
||||||
ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto))
|
|
||||||
/**
|
|
||||||
* @ingroup ip
|
|
||||||
* Output IP packet to specified interface
|
|
||||||
*/
|
|
||||||
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
|
|
||||||
ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif))
|
|
||||||
/**
|
|
||||||
* @ingroup ip
|
|
||||||
* Output IP packet to interface specifying source address
|
|
||||||
*/
|
|
||||||
#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
|
|
||||||
ip4_output_if_src(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif))
|
|
||||||
/** Output IP packet that already includes an IP header. */
|
|
||||||
#define ip_output_if_hdrincl(p, src, dest, netif) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_output_if(p, ip_2_ip6(src), LWIP_IP_HDRINCL, 0, 0, 0, netif) : \
|
|
||||||
ip4_output_if(p, ip_2_ip4(src), LWIP_IP_HDRINCL, 0, 0, 0, netif))
|
|
||||||
/** Output IP packet with netif_hint */
|
|
||||||
#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif_hint) : \
|
|
||||||
ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif_hint))
|
|
||||||
/**
|
|
||||||
* @ingroup ip
|
|
||||||
* Get netif for address combination. See \ref ip6_route and \ref ip4_route
|
|
||||||
*/
|
|
||||||
#define ip_route(src, dest) \
|
|
||||||
(IP_IS_V6(dest) ? \
|
|
||||||
ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \
|
|
||||||
ip4_route_src(ip_2_ip4(src), ip_2_ip4(dest)))
|
|
||||||
/**
|
|
||||||
* @ingroup ip
|
|
||||||
* Get netif for IP.
|
|
||||||
*/
|
|
||||||
#define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \
|
|
||||||
ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \
|
|
||||||
ip4_netif_get_local_ip(netif))
|
|
||||||
#define ip_debug_print(is_ipv6, p) ((is_ipv6) ? ip6_debug_print(p) : ip4_debug_print(p))
|
|
||||||
|
|
||||||
err_t ip_input(struct pbuf *p, struct netif *inp);
|
|
||||||
|
|
||||||
#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
#define ip_output(p, src, dest, ttl, tos, proto) \
|
|
||||||
ip4_output(p, src, dest, ttl, tos, proto)
|
|
||||||
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
ip4_output_if(p, src, dest, ttl, tos, proto, netif)
|
|
||||||
#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
ip4_output_if_src(p, src, dest, ttl, tos, proto, netif)
|
|
||||||
#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
|
|
||||||
ip4_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)
|
|
||||||
#define ip_output_if_hdrincl(p, src, dest, netif) \
|
|
||||||
ip4_output_if(p, src, LWIP_IP_HDRINCL, 0, 0, 0, netif)
|
|
||||||
#define ip_route(src, dest) \
|
|
||||||
ip4_route_src(src, dest)
|
|
||||||
#define ip_netif_get_local_ip(netif, dest) \
|
|
||||||
ip4_netif_get_local_ip(netif)
|
|
||||||
#define ip_debug_print(is_ipv6, p) ip4_debug_print(p)
|
|
||||||
|
|
||||||
#define ip_input ip4_input
|
|
||||||
|
|
||||||
#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
#define ip_output(p, src, dest, ttl, tos, proto) \
|
|
||||||
ip6_output(p, src, dest, ttl, tos, proto)
|
|
||||||
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
ip6_output_if(p, src, dest, ttl, tos, proto, netif)
|
|
||||||
#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
|
|
||||||
ip6_output_if_src(p, src, dest, ttl, tos, proto, netif)
|
|
||||||
#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
|
|
||||||
ip6_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)
|
|
||||||
#define ip_output_if_hdrincl(p, src, dest, netif) \
|
|
||||||
ip6_output_if(p, src, LWIP_IP_HDRINCL, 0, 0, 0, netif)
|
|
||||||
#define ip_route(src, dest) \
|
|
||||||
ip6_route(src, dest)
|
|
||||||
#define ip_netif_get_local_ip(netif, dest) \
|
|
||||||
ip6_netif_get_local_ip(netif, dest)
|
|
||||||
#define ip_debug_print(is_ipv6, p) ip6_debug_print(p)
|
|
||||||
|
|
||||||
#define ip_input ip6_input
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#define ip_route_get_local_ip(src, dest, netif, ipaddr) do { \
|
|
||||||
(netif) = ip_route(src, dest); \
|
|
||||||
(ipaddr) = ip_netif_get_local_ip(netif, dest); \
|
|
||||||
}while(0)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_H */
|
|
||||||
-109
@@ -1,109 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IPv4 API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP4_H
|
|
||||||
#define LWIP_HDR_IP4_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
#include "lwip/def.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip4_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/prot/ip4.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LWIP_HOOK_IP4_ROUTE_SRC
|
|
||||||
#define LWIP_IPV4_SRC_ROUTING 1
|
|
||||||
#else
|
|
||||||
#define LWIP_IPV4_SRC_ROUTING 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Currently, the function ip_output_if_opt() is only used with IGMP */
|
|
||||||
#define IP_OPTIONS_SEND (LWIP_IPV4 && LWIP_IGMP)
|
|
||||||
|
|
||||||
#define ip_init() /* Compatibility define, no init needed. */
|
|
||||||
struct netif *ip4_route(const ip4_addr_t *dest);
|
|
||||||
#if LWIP_IPV4_SRC_ROUTING
|
|
||||||
struct netif *ip4_route_src(const ip4_addr_t *src, const ip4_addr_t *dest);
|
|
||||||
#else /* LWIP_IPV4_SRC_ROUTING */
|
|
||||||
#define ip4_route_src(src, dest) ip4_route(dest)
|
|
||||||
#endif /* LWIP_IPV4_SRC_ROUTING */
|
|
||||||
err_t ip4_input(struct pbuf *p, struct netif *inp);
|
|
||||||
err_t ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto);
|
|
||||||
err_t ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto, struct netif *netif);
|
|
||||||
err_t ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto, struct netif *netif);
|
|
||||||
#if LWIP_NETIF_USE_HINTS
|
|
||||||
err_t ip4_output_hinted(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto, struct netif_hint *netif_hint);
|
|
||||||
#endif /* LWIP_NETIF_USE_HINTS */
|
|
||||||
#if IP_OPTIONS_SEND
|
|
||||||
err_t ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options,
|
|
||||||
u16_t optlen);
|
|
||||||
err_t ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
|
||||||
u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options,
|
|
||||||
u16_t optlen);
|
|
||||||
#endif /* IP_OPTIONS_SEND */
|
|
||||||
|
|
||||||
#if LWIP_MULTICAST_TX_OPTIONS
|
|
||||||
void ip4_set_default_multicast_netif(struct netif* default_multicast_netif);
|
|
||||||
#endif /* LWIP_MULTICAST_TX_OPTIONS */
|
|
||||||
|
|
||||||
#define ip4_netif_get_local_ip(netif) (((netif) != NULL) ? netif_ip_addr4(netif) : NULL)
|
|
||||||
|
|
||||||
#if IP_DEBUG
|
|
||||||
void ip4_debug_print(struct pbuf *p);
|
|
||||||
#else
|
|
||||||
#define ip4_debug_print(p)
|
|
||||||
#endif /* IP_DEBUG */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_H */
|
|
||||||
-216
@@ -1,216 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IPv4 address API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP4_ADDR_H
|
|
||||||
#define LWIP_HDR_IP4_ADDR_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/def.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** This is the aligned version of ip4_addr_t,
|
|
||||||
used as local variable, on the stack, etc. */
|
|
||||||
struct ip4_addr {
|
|
||||||
u32_t addr;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** ip4_addr_t uses a struct for convenience only, so that the same defines can
|
|
||||||
* operate both on ip4_addr_t as well as on ip4_addr_p_t. */
|
|
||||||
typedef struct ip4_addr ip4_addr_t;
|
|
||||||
|
|
||||||
/* Forward declaration to not include netif.h */
|
|
||||||
struct netif;
|
|
||||||
|
|
||||||
/** 255.255.255.255 */
|
|
||||||
#define IPADDR_NONE ((u32_t)0xffffffffUL)
|
|
||||||
/** 127.0.0.1 */
|
|
||||||
#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL)
|
|
||||||
/** 0.0.0.0 */
|
|
||||||
#define IPADDR_ANY ((u32_t)0x00000000UL)
|
|
||||||
/** 255.255.255.255 */
|
|
||||||
#define IPADDR_BROADCAST ((u32_t)0xffffffffUL)
|
|
||||||
|
|
||||||
/* Definitions of the bits in an Internet address integer.
|
|
||||||
|
|
||||||
On subnets, host and network parts are found according to
|
|
||||||
the subnet mask, not these masks. */
|
|
||||||
#define IP_CLASSA(a) ((((u32_t)(a)) & 0x80000000UL) == 0)
|
|
||||||
#define IP_CLASSA_NET 0xff000000
|
|
||||||
#define IP_CLASSA_NSHIFT 24
|
|
||||||
#define IP_CLASSA_HOST (0xffffffff & ~IP_CLASSA_NET)
|
|
||||||
#define IP_CLASSA_MAX 128
|
|
||||||
|
|
||||||
#define IP_CLASSB(a) ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL)
|
|
||||||
#define IP_CLASSB_NET 0xffff0000
|
|
||||||
#define IP_CLASSB_NSHIFT 16
|
|
||||||
#define IP_CLASSB_HOST (0xffffffff & ~IP_CLASSB_NET)
|
|
||||||
#define IP_CLASSB_MAX 65536
|
|
||||||
|
|
||||||
#define IP_CLASSC(a) ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL)
|
|
||||||
#define IP_CLASSC_NET 0xffffff00
|
|
||||||
#define IP_CLASSC_NSHIFT 8
|
|
||||||
#define IP_CLASSC_HOST (0xffffffff & ~IP_CLASSC_NET)
|
|
||||||
|
|
||||||
#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL)
|
|
||||||
#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */
|
|
||||||
#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */
|
|
||||||
#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */
|
|
||||||
#define IP_MULTICAST(a) IP_CLASSD(a)
|
|
||||||
|
|
||||||
#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL)
|
|
||||||
#define IP_BADCLASS(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL)
|
|
||||||
|
|
||||||
#define IP_LOOPBACKNET 127 /* official! */
|
|
||||||
|
|
||||||
/** Set an IP address given by the four byte-parts */
|
|
||||||
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d))
|
|
||||||
|
|
||||||
/** Copy IP address - faster than ip4_addr_set: no NULL check */
|
|
||||||
#define ip4_addr_copy(dest, src) ((dest).addr = (src).addr)
|
|
||||||
/** Safely copy one IP address to another (src may be NULL) */
|
|
||||||
#define ip4_addr_set(dest, src) ((dest)->addr = \
|
|
||||||
((src) == NULL ? 0 : \
|
|
||||||
(src)->addr))
|
|
||||||
/** Set complete address to zero */
|
|
||||||
#define ip4_addr_set_zero(ipaddr) ((ipaddr)->addr = 0)
|
|
||||||
/** Set address to IPADDR_ANY (no need for lwip_htonl()) */
|
|
||||||
#define ip4_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY)
|
|
||||||
/** Set address to loopback address */
|
|
||||||
#define ip4_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK))
|
|
||||||
/** Check if an address is in the loopback region */
|
|
||||||
#define ip4_addr_isloopback(ipaddr) (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24))
|
|
||||||
/** Safely copy one IP address to another and change byte order
|
|
||||||
* from host- to network-order. */
|
|
||||||
#define ip4_addr_set_hton(dest, src) ((dest)->addr = \
|
|
||||||
((src) == NULL ? 0:\
|
|
||||||
lwip_htonl((src)->addr)))
|
|
||||||
/** IPv4 only: set the IP address given as an u32_t */
|
|
||||||
#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32))
|
|
||||||
/** IPv4 only: get the IP address as an u32_t */
|
|
||||||
#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr)
|
|
||||||
|
|
||||||
/** Get the network address by combining host address with netmask */
|
|
||||||
#define ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if two address are on the same network.
|
|
||||||
*
|
|
||||||
* @arg addr1 IP address 1
|
|
||||||
* @arg addr2 IP address 2
|
|
||||||
* @arg mask network identifier mask
|
|
||||||
* @return !0 if the network identifiers of both address match
|
|
||||||
*/
|
|
||||||
#define ip4_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
|
|
||||||
(mask)->addr) == \
|
|
||||||
((addr2)->addr & \
|
|
||||||
(mask)->addr))
|
|
||||||
#define ip4_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)
|
|
||||||
|
|
||||||
#define ip4_addr_isany_val(addr1) ((addr1).addr == IPADDR_ANY)
|
|
||||||
#define ip4_addr_isany(addr1) ((addr1) == NULL || ip4_addr_isany_val(*(addr1)))
|
|
||||||
|
|
||||||
#define ip4_addr_isbroadcast(addr1, netif) ip4_addr_isbroadcast_u32((addr1)->addr, netif)
|
|
||||||
u8_t ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif);
|
|
||||||
|
|
||||||
#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr)
|
|
||||||
u8_t ip4_addr_netmask_valid(u32_t netmask);
|
|
||||||
|
|
||||||
#define ip4_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL))
|
|
||||||
|
|
||||||
#define ip4_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL))
|
|
||||||
|
|
||||||
#define ip4_addr_debug_print_parts(debug, a, b, c, d) \
|
|
||||||
LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d))
|
|
||||||
#define ip4_addr_debug_print(debug, ipaddr) \
|
|
||||||
ip4_addr_debug_print_parts(debug, \
|
|
||||||
(u16_t)((ipaddr) != NULL ? ip4_addr1_16(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? ip4_addr2_16(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? ip4_addr3_16(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? ip4_addr4_16(ipaddr) : 0))
|
|
||||||
#define ip4_addr_debug_print_val(debug, ipaddr) \
|
|
||||||
ip4_addr_debug_print_parts(debug, \
|
|
||||||
ip4_addr1_16_val(ipaddr), \
|
|
||||||
ip4_addr2_16_val(ipaddr), \
|
|
||||||
ip4_addr3_16_val(ipaddr), \
|
|
||||||
ip4_addr4_16_val(ipaddr))
|
|
||||||
|
|
||||||
/* Get one byte from the 4-byte address */
|
|
||||||
#define ip4_addr_get_byte(ipaddr, idx) (((const u8_t*)(&(ipaddr)->addr))[idx])
|
|
||||||
#define ip4_addr1(ipaddr) ip4_addr_get_byte(ipaddr, 0)
|
|
||||||
#define ip4_addr2(ipaddr) ip4_addr_get_byte(ipaddr, 1)
|
|
||||||
#define ip4_addr3(ipaddr) ip4_addr_get_byte(ipaddr, 2)
|
|
||||||
#define ip4_addr4(ipaddr) ip4_addr_get_byte(ipaddr, 3)
|
|
||||||
/* Get one byte from the 4-byte address, but argument is 'ip4_addr_t',
|
|
||||||
* not a pointer */
|
|
||||||
#define ip4_addr_get_byte_val(ipaddr, idx) ((u8_t)(((ipaddr).addr >> (idx * 8)) & 0xff))
|
|
||||||
#define ip4_addr1_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 0)
|
|
||||||
#define ip4_addr2_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 1)
|
|
||||||
#define ip4_addr3_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 2)
|
|
||||||
#define ip4_addr4_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 3)
|
|
||||||
/* These are cast to u16_t, with the intent that they are often arguments
|
|
||||||
* to printf using the U16_F format from cc.h. */
|
|
||||||
#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr))
|
|
||||||
#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr))
|
|
||||||
#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr))
|
|
||||||
#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr))
|
|
||||||
#define ip4_addr1_16_val(ipaddr) ((u16_t)ip4_addr1_val(ipaddr))
|
|
||||||
#define ip4_addr2_16_val(ipaddr) ((u16_t)ip4_addr2_val(ipaddr))
|
|
||||||
#define ip4_addr3_16_val(ipaddr) ((u16_t)ip4_addr3_val(ipaddr))
|
|
||||||
#define ip4_addr4_16_val(ipaddr) ((u16_t)ip4_addr4_val(ipaddr))
|
|
||||||
|
|
||||||
#define IP4ADDR_STRLEN_MAX 16
|
|
||||||
|
|
||||||
/** For backwards compatibility */
|
|
||||||
#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr)
|
|
||||||
|
|
||||||
u32_t ipaddr_addr(const char *cp);
|
|
||||||
int ip4addr_aton(const char *cp, ip4_addr_t *addr);
|
|
||||||
/** returns ptr to static buffer; not reentrant! */
|
|
||||||
char *ip4addr_ntoa(const ip4_addr_t *addr);
|
|
||||||
char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_ADDR_H */
|
|
||||||
-100
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IP fragmentation/reassembly
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Jani Monoses <jani@iv.ro>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_IP4_FRAG_H
|
|
||||||
#define LWIP_HDR_IP4_FRAG_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/ip.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if IP_REASSEMBLY
|
|
||||||
/* The IP reassembly timer interval in milliseconds. */
|
|
||||||
#define IP_TMR_INTERVAL 1000
|
|
||||||
|
|
||||||
/** IP reassembly helper struct.
|
|
||||||
* This is exported because memp needs to know the size.
|
|
||||||
*/
|
|
||||||
struct ip_reassdata {
|
|
||||||
struct ip_reassdata *next;
|
|
||||||
struct pbuf *p;
|
|
||||||
struct ip_hdr iphdr;
|
|
||||||
u16_t datagram_len;
|
|
||||||
u8_t flags;
|
|
||||||
u8_t timer;
|
|
||||||
};
|
|
||||||
|
|
||||||
void ip_reass_init(void);
|
|
||||||
void ip_reass_tmr(void);
|
|
||||||
struct pbuf * ip4_reass(struct pbuf *p);
|
|
||||||
#endif /* IP_REASSEMBLY */
|
|
||||||
|
|
||||||
#if IP_FRAG
|
|
||||||
#if !LWIP_NETIF_TX_SINGLE_PBUF
|
|
||||||
#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED
|
|
||||||
#define LWIP_PBUF_CUSTOM_REF_DEFINED
|
|
||||||
/** A custom pbuf that holds a reference to another pbuf, which is freed
|
|
||||||
* when this custom pbuf is freed. This is used to create a custom PBUF_REF
|
|
||||||
* that points into the original pbuf. */
|
|
||||||
struct pbuf_custom_ref {
|
|
||||||
/** 'base class' */
|
|
||||||
struct pbuf_custom pc;
|
|
||||||
/** pointer to the original pbuf that is referenced */
|
|
||||||
struct pbuf *original;
|
|
||||||
};
|
|
||||||
#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */
|
|
||||||
#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */
|
|
||||||
|
|
||||||
err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest);
|
|
||||||
#endif /* IP_FRAG */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP4_FRAG_H */
|
|
||||||
-93
@@ -1,93 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* IPv6 layer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP6_H
|
|
||||||
#define LWIP_HDR_IP6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/prot/ip6.h"
|
|
||||||
#include "lwip/def.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct netif *ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest);
|
|
||||||
const ip_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest);
|
|
||||||
err_t ip6_input(struct pbuf *p, struct netif *inp);
|
|
||||||
err_t ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
|
||||||
u8_t hl, u8_t tc, u8_t nexth);
|
|
||||||
err_t ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
|
||||||
u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);
|
|
||||||
err_t ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
|
||||||
u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);
|
|
||||||
#if LWIP_NETIF_USE_HINTS
|
|
||||||
err_t ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
|
||||||
u8_t hl, u8_t tc, u8_t nexth, struct netif_hint *netif_hint);
|
|
||||||
#endif /* LWIP_NETIF_USE_HINTS */
|
|
||||||
#if LWIP_IPV6_MLD
|
|
||||||
err_t ip6_options_add_hbh_ra(struct pbuf * p, u8_t nexth, u8_t value);
|
|
||||||
#endif /* LWIP_IPV6_MLD */
|
|
||||||
|
|
||||||
#define ip6_netif_get_local_ip(netif, dest) (((netif) != NULL) ? \
|
|
||||||
ip6_select_source_address(netif, dest) : NULL)
|
|
||||||
|
|
||||||
#if IP6_DEBUG
|
|
||||||
void ip6_debug_print(struct pbuf *p);
|
|
||||||
#else
|
|
||||||
#define ip6_debug_print(p)
|
|
||||||
#endif /* IP6_DEBUG */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP6_H */
|
|
||||||
-352
@@ -1,352 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* IPv6 addresses.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
* Structs and macros for handling IPv6 addresses.
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP6_ADDR_H
|
|
||||||
#define LWIP_HDR_IP6_ADDR_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "def.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/ip6_zone.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/** This is the aligned version of ip6_addr_t,
|
|
||||||
used as local variable, on the stack, etc. */
|
|
||||||
struct ip6_addr {
|
|
||||||
u32_t addr[4];
|
|
||||||
#if LWIP_IPV6_SCOPES
|
|
||||||
u8_t zone;
|
|
||||||
#endif /* LWIP_IPV6_SCOPES */
|
|
||||||
};
|
|
||||||
|
|
||||||
/** IPv6 address */
|
|
||||||
typedef struct ip6_addr ip6_addr_t;
|
|
||||||
|
|
||||||
/** Set an IPv6 partial address given by byte-parts */
|
|
||||||
#define IP6_ADDR_PART(ip6addr, index, a,b,c,d) \
|
|
||||||
(ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d))
|
|
||||||
|
|
||||||
/** Set a full IPv6 address by passing the 4 u32_t indices in network byte order
|
|
||||||
(use PP_HTONL() for constants) */
|
|
||||||
#define IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) do { \
|
|
||||||
(ip6addr)->addr[0] = idx0; \
|
|
||||||
(ip6addr)->addr[1] = idx1; \
|
|
||||||
(ip6addr)->addr[2] = idx2; \
|
|
||||||
(ip6addr)->addr[3] = idx3; \
|
|
||||||
ip6_addr_clear_zone(ip6addr); } while(0)
|
|
||||||
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff))
|
|
||||||
/** Access address in 16-bit block */
|
|
||||||
#define IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff))
|
|
||||||
|
|
||||||
/** Copy IPv6 address - faster than ip6_addr_set: no NULL check */
|
|
||||||
#define ip6_addr_copy(dest, src) do{(dest).addr[0] = (src).addr[0]; \
|
|
||||||
(dest).addr[1] = (src).addr[1]; \
|
|
||||||
(dest).addr[2] = (src).addr[2]; \
|
|
||||||
(dest).addr[3] = (src).addr[3]; \
|
|
||||||
ip6_addr_copy_zone((dest), (src)); }while(0)
|
|
||||||
/** Safely copy one IPv6 address to another (src may be NULL) */
|
|
||||||
#define ip6_addr_set(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : (src)->addr[0]; \
|
|
||||||
(dest)->addr[1] = (src) == NULL ? 0 : (src)->addr[1]; \
|
|
||||||
(dest)->addr[2] = (src) == NULL ? 0 : (src)->addr[2]; \
|
|
||||||
(dest)->addr[3] = (src) == NULL ? 0 : (src)->addr[3]; \
|
|
||||||
ip6_addr_set_zone((dest), (src) == NULL ? IP6_NO_ZONE : ip6_addr_zone(src)); }while(0)
|
|
||||||
|
|
||||||
/** Copy packed IPv6 address to unpacked IPv6 address; zone is not set */
|
|
||||||
#define ip6_addr_copy_from_packed(dest, src) do{(dest).addr[0] = (src).addr[0]; \
|
|
||||||
(dest).addr[1] = (src).addr[1]; \
|
|
||||||
(dest).addr[2] = (src).addr[2]; \
|
|
||||||
(dest).addr[3] = (src).addr[3]; \
|
|
||||||
ip6_addr_clear_zone(&dest); }while(0)
|
|
||||||
|
|
||||||
/** Copy unpacked IPv6 address to packed IPv6 address; zone is lost */
|
|
||||||
#define ip6_addr_copy_to_packed(dest, src) do{(dest).addr[0] = (src).addr[0]; \
|
|
||||||
(dest).addr[1] = (src).addr[1]; \
|
|
||||||
(dest).addr[2] = (src).addr[2]; \
|
|
||||||
(dest).addr[3] = (src).addr[3]; }while(0)
|
|
||||||
|
|
||||||
/** Set complete address to zero */
|
|
||||||
#define ip6_addr_set_zero(ip6addr) do{(ip6addr)->addr[0] = 0; \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[2] = 0; \
|
|
||||||
(ip6addr)->addr[3] = 0; \
|
|
||||||
ip6_addr_clear_zone(ip6addr);}while(0)
|
|
||||||
|
|
||||||
/** Set address to ipv6 'any' (no need for lwip_htonl()) */
|
|
||||||
#define ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr)
|
|
||||||
/** Set address to ipv6 loopback address */
|
|
||||||
#define ip6_addr_set_loopback(ip6addr) do{(ip6addr)->addr[0] = 0; \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[2] = 0; \
|
|
||||||
(ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
|
|
||||||
ip6_addr_clear_zone(ip6addr);}while(0)
|
|
||||||
/** Safely copy one IPv6 address to another and change byte order
|
|
||||||
* from host- to network-order. */
|
|
||||||
#define ip6_addr_set_hton(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : lwip_htonl((src)->addr[0]); \
|
|
||||||
(dest)->addr[1] = (src) == NULL ? 0 : lwip_htonl((src)->addr[1]); \
|
|
||||||
(dest)->addr[2] = (src) == NULL ? 0 : lwip_htonl((src)->addr[2]); \
|
|
||||||
(dest)->addr[3] = (src) == NULL ? 0 : lwip_htonl((src)->addr[3]); \
|
|
||||||
ip6_addr_set_zone((dest), (src) == NULL ? IP6_NO_ZONE : ip6_addr_zone(src));}while(0)
|
|
||||||
|
|
||||||
|
|
||||||
/** Compare IPv6 networks, ignoring zone information. To be used sparingly! */
|
|
||||||
#define ip6_addr_netcmp_zoneless(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \
|
|
||||||
((addr1)->addr[1] == (addr2)->addr[1]))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if two IPv6 address are on the same network.
|
|
||||||
*
|
|
||||||
* @param addr1 IPv6 address 1
|
|
||||||
* @param addr2 IPv6 address 2
|
|
||||||
* @return 1 if the network identifiers of both address match, 0 if not
|
|
||||||
*/
|
|
||||||
#define ip6_addr_netcmp(addr1, addr2) (ip6_addr_netcmp_zoneless((addr1), (addr2)) && \
|
|
||||||
ip6_addr_cmp_zone((addr1), (addr2)))
|
|
||||||
|
|
||||||
/* Exact-host comparison *after* ip6_addr_netcmp() succeeded, for efficiency. */
|
|
||||||
#define ip6_addr_nethostcmp(addr1, addr2) (((addr1)->addr[2] == (addr2)->addr[2]) && \
|
|
||||||
((addr1)->addr[3] == (addr2)->addr[3]))
|
|
||||||
|
|
||||||
/** Compare IPv6 addresses, ignoring zone information. To be used sparingly! */
|
|
||||||
#define ip6_addr_cmp_zoneless(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \
|
|
||||||
((addr1)->addr[1] == (addr2)->addr[1]) && \
|
|
||||||
((addr1)->addr[2] == (addr2)->addr[2]) && \
|
|
||||||
((addr1)->addr[3] == (addr2)->addr[3]))
|
|
||||||
/**
|
|
||||||
* Determine if two IPv6 addresses are the same. In particular, the address
|
|
||||||
* part of both must be the same, and the zone must be compatible.
|
|
||||||
*
|
|
||||||
* @param addr1 IPv6 address 1
|
|
||||||
* @param addr2 IPv6 address 2
|
|
||||||
* @return 1 if the addresses are considered equal, 0 if not
|
|
||||||
*/
|
|
||||||
#define ip6_addr_cmp(addr1, addr2) (ip6_addr_cmp_zoneless((addr1), (addr2)) && \
|
|
||||||
ip6_addr_cmp_zone((addr1), (addr2)))
|
|
||||||
|
|
||||||
/** Compare IPv6 address to packed address and zone */
|
|
||||||
#define ip6_addr_cmp_packed(ip6addr, paddr, zone_idx) (((ip6addr)->addr[0] == (paddr)->addr[0]) && \
|
|
||||||
((ip6addr)->addr[1] == (paddr)->addr[1]) && \
|
|
||||||
((ip6addr)->addr[2] == (paddr)->addr[2]) && \
|
|
||||||
((ip6addr)->addr[3] == (paddr)->addr[3]) && \
|
|
||||||
ip6_addr_equals_zone((ip6addr), (zone_idx)))
|
|
||||||
|
|
||||||
#define ip6_get_subnet_id(ip6addr) (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL)
|
|
||||||
|
|
||||||
#define ip6_addr_isany_val(ip6addr) (((ip6addr).addr[0] == 0) && \
|
|
||||||
((ip6addr).addr[1] == 0) && \
|
|
||||||
((ip6addr).addr[2] == 0) && \
|
|
||||||
((ip6addr).addr[3] == 0))
|
|
||||||
#define ip6_addr_isany(ip6addr) (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr)))
|
|
||||||
|
|
||||||
#define ip6_addr_isloopback(ip6addr) (((ip6addr)->addr[0] == 0UL) && \
|
|
||||||
((ip6addr)->addr[1] == 0UL) && \
|
|
||||||
((ip6addr)->addr[2] == 0UL) && \
|
|
||||||
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))
|
|
||||||
|
|
||||||
#define ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL))
|
|
||||||
|
|
||||||
#define ip6_addr_islinklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL))
|
|
||||||
|
|
||||||
#define ip6_addr_issitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL))
|
|
||||||
|
|
||||||
#define ip6_addr_isuniquelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL))
|
|
||||||
|
|
||||||
#define ip6_addr_isipv4mappedipv6(ip6addr) (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL)))
|
|
||||||
|
|
||||||
#define ip6_addr_ismulticast(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL))
|
|
||||||
#define ip6_addr_multicast_transient_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL))
|
|
||||||
#define ip6_addr_multicast_prefix_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL))
|
|
||||||
#define ip6_addr_multicast_rendezvous_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL))
|
|
||||||
#define ip6_addr_multicast_scope(ip6addr) ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xf)
|
|
||||||
#define IP6_MULTICAST_SCOPE_RESERVED 0x0
|
|
||||||
#define IP6_MULTICAST_SCOPE_RESERVED0 0x0
|
|
||||||
#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL 0x1
|
|
||||||
#define IP6_MULTICAST_SCOPE_LINK_LOCAL 0x2
|
|
||||||
#define IP6_MULTICAST_SCOPE_RESERVED3 0x3
|
|
||||||
#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL 0x4
|
|
||||||
#define IP6_MULTICAST_SCOPE_SITE_LOCAL 0x5
|
|
||||||
#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 0x8
|
|
||||||
#define IP6_MULTICAST_SCOPE_GLOBAL 0xe
|
|
||||||
#define IP6_MULTICAST_SCOPE_RESERVEDF 0xf
|
|
||||||
#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL))
|
|
||||||
#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL))
|
|
||||||
#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL))
|
|
||||||
#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL))
|
|
||||||
#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL))
|
|
||||||
#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL))
|
|
||||||
|
|
||||||
/* Scoping note: while interface-local and link-local multicast addresses do
|
|
||||||
* have a scope (i.e., they are meaningful only in the context of a particular
|
|
||||||
* interface), the following functions are not assigning or comparing zone
|
|
||||||
* indices. The reason for this is backward compatibility. Any call site that
|
|
||||||
* produces a non-global multicast address must assign a multicast address as
|
|
||||||
* appropriate itself. */
|
|
||||||
|
|
||||||
#define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \
|
|
||||||
((ip6addr)->addr[1] == 0UL) && \
|
|
||||||
((ip6addr)->addr[2] == 0UL) && \
|
|
||||||
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))
|
|
||||||
|
|
||||||
#define ip6_addr_isallnodes_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
|
|
||||||
((ip6addr)->addr[1] == 0UL) && \
|
|
||||||
((ip6addr)->addr[2] == 0UL) && \
|
|
||||||
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))
|
|
||||||
#define ip6_addr_set_allnodes_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[2] = 0; \
|
|
||||||
(ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
|
|
||||||
ip6_addr_clear_zone(ip6addr); }while(0)
|
|
||||||
|
|
||||||
#define ip6_addr_isallrouters_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
|
|
||||||
((ip6addr)->addr[1] == 0UL) && \
|
|
||||||
((ip6addr)->addr[2] == 0UL) && \
|
|
||||||
((ip6addr)->addr[3] == PP_HTONL(0x00000002UL)))
|
|
||||||
#define ip6_addr_set_allrouters_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[2] = 0; \
|
|
||||||
(ip6addr)->addr[3] = PP_HTONL(0x00000002UL); \
|
|
||||||
ip6_addr_clear_zone(ip6addr); }while(0)
|
|
||||||
|
|
||||||
#define ip6_addr_issolicitednode(ip6addr) ( ((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
|
|
||||||
((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
|
|
||||||
(((ip6addr)->addr[3] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) )
|
|
||||||
|
|
||||||
#define ip6_addr_set_solicitednode(ip6addr, if_id) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[2] = PP_HTONL(0x00000001UL); \
|
|
||||||
(ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id)); \
|
|
||||||
ip6_addr_clear_zone(ip6addr); }while(0)
|
|
||||||
|
|
||||||
#define ip6_addr_cmp_solicitednode(ip6addr, sn_addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
|
|
||||||
((ip6addr)->addr[1] == 0) && \
|
|
||||||
((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
|
|
||||||
((ip6addr)->addr[3] == (PP_HTONL(0xff000000UL) | (sn_addr)->addr[3])))
|
|
||||||
|
|
||||||
/* IPv6 address states. */
|
|
||||||
#define IP6_ADDR_INVALID 0x00
|
|
||||||
#define IP6_ADDR_TENTATIVE 0x08
|
|
||||||
#define IP6_ADDR_TENTATIVE_1 0x09 /* 1 probe sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_2 0x0a /* 2 probes sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_3 0x0b /* 3 probes sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_4 0x0c /* 4 probes sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_5 0x0d /* 5 probes sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_6 0x0e /* 6 probes sent */
|
|
||||||
#define IP6_ADDR_TENTATIVE_7 0x0f /* 7 probes sent */
|
|
||||||
#define IP6_ADDR_VALID 0x10 /* This bit marks an address as valid (preferred or deprecated) */
|
|
||||||
#define IP6_ADDR_PREFERRED 0x30
|
|
||||||
#define IP6_ADDR_DEPRECATED 0x10 /* Same as VALID (valid but not preferred) */
|
|
||||||
#define IP6_ADDR_DUPLICATED 0x40 /* Failed DAD test, not valid */
|
|
||||||
|
|
||||||
#define IP6_ADDR_TENTATIVE_COUNT_MASK 0x07 /* 1-7 probes sent */
|
|
||||||
|
|
||||||
#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID)
|
|
||||||
#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE)
|
|
||||||
#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */
|
|
||||||
#define ip6_addr_ispreferred(addr_state) (addr_state == IP6_ADDR_PREFERRED)
|
|
||||||
#define ip6_addr_isdeprecated(addr_state) (addr_state == IP6_ADDR_DEPRECATED)
|
|
||||||
#define ip6_addr_isduplicated(addr_state) (addr_state == IP6_ADDR_DUPLICATED)
|
|
||||||
|
|
||||||
#if LWIP_IPV6_ADDRESS_LIFETIMES
|
|
||||||
#define IP6_ADDR_LIFE_STATIC (0)
|
|
||||||
#define IP6_ADDR_LIFE_INFINITE (0xffffffffUL)
|
|
||||||
#define ip6_addr_life_isstatic(addr_life) ((addr_life) == IP6_ADDR_LIFE_STATIC)
|
|
||||||
#define ip6_addr_life_isinfinite(addr_life) ((addr_life) == IP6_ADDR_LIFE_INFINITE)
|
|
||||||
#endif /* LWIP_IPV6_ADDRESS_LIFETIMES */
|
|
||||||
|
|
||||||
#define ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h) \
|
|
||||||
LWIP_DEBUGF(debug, ("%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F, \
|
|
||||||
a, b, c, d, e, f, g, h))
|
|
||||||
#define ip6_addr_debug_print(debug, ipaddr) \
|
|
||||||
ip6_addr_debug_print_parts(debug, \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK1(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK2(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK3(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK4(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK5(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK6(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0), \
|
|
||||||
(u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0))
|
|
||||||
#define ip6_addr_debug_print_val(debug, ipaddr) \
|
|
||||||
ip6_addr_debug_print_parts(debug, \
|
|
||||||
IP6_ADDR_BLOCK1(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK2(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK3(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK4(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK5(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK6(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK7(&(ipaddr)), \
|
|
||||||
IP6_ADDR_BLOCK8(&(ipaddr)))
|
|
||||||
|
|
||||||
#define IP6ADDR_STRLEN_MAX 46
|
|
||||||
|
|
||||||
int ip6addr_aton(const char *cp, ip6_addr_t *addr);
|
|
||||||
/** returns ptr to static buffer; not reentrant! */
|
|
||||||
char *ip6addr_ntoa(const ip6_addr_t *addr);
|
|
||||||
char *ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP6_ADDR_H */
|
|
||||||
-144
@@ -1,144 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* IPv6 fragmentation and reassembly.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP6_FRAG_H
|
|
||||||
#define LWIP_HDR_IP6_FRAG_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/ip6.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/** The IPv6 reassembly timer interval in milliseconds. */
|
|
||||||
#define IP6_REASS_TMR_INTERVAL 1000
|
|
||||||
|
|
||||||
/** IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, "struct
|
|
||||||
* ip6_reass_helper" is too large to be stored in the IPv6 fragment header, and
|
|
||||||
* will bleed into the header before it, which may be the IPv6 header or an
|
|
||||||
* extension header. This means that for each first fragment packet, we need to
|
|
||||||
* 1) make a copy of some IPv6 header fields (src+dest) that we need later on,
|
|
||||||
* just in case we do overwrite part of the IPv6 header, and 2) make a copy of
|
|
||||||
* the header data that we overwrote, so that we can restore it before either
|
|
||||||
* completing reassembly or sending an ICMPv6 reply. The last part is true even
|
|
||||||
* if this setting is disabled, but if it is enabled, we need to save a bit
|
|
||||||
* more data (up to the size of a pointer) because we overwrite more. */
|
|
||||||
#ifndef IPV6_FRAG_COPYHEADER
|
|
||||||
#define IPV6_FRAG_COPYHEADER 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* With IPV6_FRAG_COPYHEADER==1, a helper structure may (or, depending on the
|
|
||||||
* presence of extensions, may not) overwrite part of the IP header. Therefore,
|
|
||||||
* we copy the fields that we need from the IP header for as long as the helper
|
|
||||||
* structure may still be in place. This is easier than temporarily restoring
|
|
||||||
* those fields in the IP header each time we need to perform checks on them. */
|
|
||||||
#if IPV6_FRAG_COPYHEADER
|
|
||||||
#define IPV6_FRAG_SRC(ipr) ((ipr)->src)
|
|
||||||
#define IPV6_FRAG_DEST(ipr) ((ipr)->dest)
|
|
||||||
#else /* IPV6_FRAG_COPYHEADER */
|
|
||||||
#define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
|
|
||||||
#define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
|
|
||||||
#endif /* IPV6_FRAG_COPYHEADER */
|
|
||||||
|
|
||||||
/** IPv6 reassembly helper struct.
|
|
||||||
* This is exported because memp needs to know the size.
|
|
||||||
*/
|
|
||||||
struct ip6_reassdata {
|
|
||||||
struct ip6_reassdata *next;
|
|
||||||
struct pbuf *p;
|
|
||||||
struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */
|
|
||||||
#if IPV6_FRAG_COPYHEADER
|
|
||||||
ip6_addr_p_t src; /* copy of the source address in the IP header */
|
|
||||||
ip6_addr_p_t dest; /* copy of the destination address in the IP header */
|
|
||||||
/* This buffer (for the part of the original header that we overwrite) will
|
|
||||||
* be slightly oversized, but we cannot compute the exact size from here. */
|
|
||||||
u8_t orig_hdr[sizeof(struct ip6_frag_hdr) + sizeof(void*)];
|
|
||||||
#else /* IPV6_FRAG_COPYHEADER */
|
|
||||||
/* In this case we still need the buffer, for sending ICMPv6 replies. */
|
|
||||||
u8_t orig_hdr[sizeof(struct ip6_frag_hdr)];
|
|
||||||
#endif /* IPV6_FRAG_COPYHEADER */
|
|
||||||
u32_t identification;
|
|
||||||
u16_t datagram_len;
|
|
||||||
u8_t nexth;
|
|
||||||
u8_t timer;
|
|
||||||
#if LWIP_IPV6_SCOPES
|
|
||||||
u8_t src_zone; /* zone of original packet's source address */
|
|
||||||
u8_t dest_zone; /* zone of original packet's destination address */
|
|
||||||
#endif /* LWIP_IPV6_SCOPES */
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ip6_reass_init() /* Compatibility define */
|
|
||||||
void ip6_reass_tmr(void);
|
|
||||||
struct pbuf *ip6_reass(struct pbuf *p);
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_FRAG /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED
|
|
||||||
#define LWIP_PBUF_CUSTOM_REF_DEFINED
|
|
||||||
/** A custom pbuf that holds a reference to another pbuf, which is freed
|
|
||||||
* when this custom pbuf is freed. This is used to create a custom PBUF_REF
|
|
||||||
* that points into the original pbuf. */
|
|
||||||
struct pbuf_custom_ref {
|
|
||||||
/** 'base class' */
|
|
||||||
struct pbuf_custom pc;
|
|
||||||
/** pointer to the original pbuf that is referenced */
|
|
||||||
struct pbuf *original;
|
|
||||||
};
|
|
||||||
#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */
|
|
||||||
|
|
||||||
err_t ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest);
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_FRAG */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP6_FRAG_H */
|
|
||||||
-304
@@ -1,304 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* IPv6 address scopes, zones, and scoping policy.
|
|
||||||
*
|
|
||||||
* This header provides the means to implement support for IPv6 address scopes,
|
|
||||||
* as per RFC 4007. An address scope can be either global or more constrained.
|
|
||||||
* In lwIP, we say that an address "has a scope" or "is scoped" when its scope
|
|
||||||
* is constrained, in which case the address is meaningful only in a specific
|
|
||||||
* "zone." For unicast addresses, only link-local addresses have a scope; in
|
|
||||||
* that case, the scope is the link. For multicast addresses, there are various
|
|
||||||
* scopes defined by RFC 4007 and others. For any constrained scope, a system
|
|
||||||
* must establish a (potentially one-to-many) mapping between zones and local
|
|
||||||
* interfaces. For example, a link-local address is valid on only one link (its
|
|
||||||
* zone). That link may be attached to one or more local interfaces. The
|
|
||||||
* decisions on which scopes are constrained and the mapping between zones and
|
|
||||||
* interfaces is together what we refer to as the "scoping policy" - more on
|
|
||||||
* this in a bit.
|
|
||||||
*
|
|
||||||
* In lwIP, each IPv6 address has an associated zone index. This zone index may
|
|
||||||
* be set to "no zone" (IP6_NO_ZONE, 0) or an actual zone. We say that an
|
|
||||||
* address "has a zone" or "is zoned" when its zone index is *not* set to "no
|
|
||||||
* zone." In lwIP, in principle, each address should be "properly zoned," which
|
|
||||||
* means that if the address has a zone if and only if has a scope. As such, it
|
|
||||||
* is a rule that an unscoped (e.g., global) address must never have a zone.
|
|
||||||
* Even though one could argue that there is always one zone even for global
|
|
||||||
* scopes, this rule exists for implementation simplicity. Violation of the
|
|
||||||
* rule will trigger assertions or otherwise result in undesired behavior.
|
|
||||||
*
|
|
||||||
* Backward compatibility prevents us from requiring that applications always
|
|
||||||
* provide properly zoned addresses. We do enforce the rule that the in the
|
|
||||||
* lwIP link layer (everything below netif->output_ip6() and in particular ND6)
|
|
||||||
* *all* addresses are properly zoned. Thus, on the output paths down the
|
|
||||||
* stack, various places deal with the case of addresses that lack a zone.
|
|
||||||
* Some of them are best-effort for efficiency (e.g. the PCB bind and connect
|
|
||||||
* API calls' attempts to add missing zones); ultimately the IPv6 output
|
|
||||||
* handler (@ref ip6_output_if_src) will set a zone if necessary.
|
|
||||||
*
|
|
||||||
* Aside from dealing with scoped addresses lacking a zone, a proper IPv6
|
|
||||||
* implementation must also ensure that a packet with a scoped source and/or
|
|
||||||
* destination address does not leave its zone. This is currently implemented
|
|
||||||
* in the input and forward functions. However, for output, these checks are
|
|
||||||
* deliberately omitted in order to keep the implementation lightweight. The
|
|
||||||
* routing algorithm in @ref ip6_route will take decisions such that it will
|
|
||||||
* not cause zone violations unless the application sets bad addresses, though.
|
|
||||||
*
|
|
||||||
* In terms of scoping policy, lwIP implements the default policy from RFC 4007
|
|
||||||
* using macros in this file. This policy considers link-local unicast
|
|
||||||
* addresses and (only) interface-local and link-local multicast addresses as
|
|
||||||
* having a scope. For all these addresses, the zone is equal to the interface.
|
|
||||||
* As shown below in this file, it is possible to implement a custom policy.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 The MINIX 3 Project.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: David van Moolenbroek <david@minix3.org>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP6_ZONE_H
|
|
||||||
#define LWIP_HDR_IP6_ZONE_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup ip6_zones IPv6 Zones
|
|
||||||
* @ingroup ip6
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/** Identifier for "no zone". */
|
|
||||||
#define IP6_NO_ZONE 0
|
|
||||||
|
|
||||||
#if LWIP_IPV6_SCOPES
|
|
||||||
|
|
||||||
/** Zone initializer for static IPv6 address initialization, including comma. */
|
|
||||||
#define IPADDR6_ZONE_INIT , IP6_NO_ZONE
|
|
||||||
|
|
||||||
/** Return the zone index of the given IPv6 address; possibly "no zone". */
|
|
||||||
#define ip6_addr_zone(ip6addr) ((ip6addr)->zone)
|
|
||||||
|
|
||||||
/** Does the given IPv6 address have a zone set? (0/1) */
|
|
||||||
#define ip6_addr_has_zone(ip6addr) (ip6_addr_zone(ip6addr) != IP6_NO_ZONE)
|
|
||||||
|
|
||||||
/** Set the zone field of an IPv6 address to a particular value. */
|
|
||||||
#define ip6_addr_set_zone(ip6addr, zone_idx) ((ip6addr)->zone = (zone_idx))
|
|
||||||
|
|
||||||
/** Clear the zone field of an IPv6 address, setting it to "no zone". */
|
|
||||||
#define ip6_addr_clear_zone(ip6addr) ((ip6addr)->zone = IP6_NO_ZONE)
|
|
||||||
|
|
||||||
/** Copy the zone field from the second IPv6 address to the first one. */
|
|
||||||
#define ip6_addr_copy_zone(ip6addr1, ip6addr2) ((ip6addr1).zone = (ip6addr2).zone)
|
|
||||||
|
|
||||||
/** Is the zone field of the given IPv6 address equal to the given zone index? (0/1) */
|
|
||||||
#define ip6_addr_equals_zone(ip6addr, zone_idx) ((ip6addr)->zone == (zone_idx))
|
|
||||||
|
|
||||||
/** Are the zone fields of the given IPv6 addresses equal? (0/1)
|
|
||||||
* This macro must only be used on IPv6 addresses of the same scope. */
|
|
||||||
#define ip6_addr_cmp_zone(ip6addr1, ip6addr2) ((ip6addr1)->zone == (ip6addr2)->zone)
|
|
||||||
|
|
||||||
/** Symbolic constants for the 'type' parameters in some of the macros.
|
|
||||||
* These exist for efficiency only, allowing the macros to avoid certain tests
|
|
||||||
* when the address is known not to be of a certain type. Dead code elimination
|
|
||||||
* will do the rest. IP6_MULTICAST is supported but currently not optimized.
|
|
||||||
* @see ip6_addr_has_scope, ip6_addr_assign_zone, ip6_addr_lacks_zone.
|
|
||||||
*/
|
|
||||||
enum lwip_ipv6_scope_type
|
|
||||||
{
|
|
||||||
/** Unknown */
|
|
||||||
IP6_UNKNOWN = 0,
|
|
||||||
/** Unicast */
|
|
||||||
IP6_UNICAST = 1,
|
|
||||||
/** Multicast */
|
|
||||||
IP6_MULTICAST = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
/** IPV6_CUSTOM_SCOPES: together, the following three macro definitions,
|
|
||||||
* @ref ip6_addr_has_scope, @ref ip6_addr_assign_zone, and
|
|
||||||
* @ref ip6_addr_test_zone, completely define the lwIP scoping policy.
|
|
||||||
* The definitions below implement the default policy from RFC 4007 Sec. 6.
|
|
||||||
* Should an implementation desire to implement a different policy, it can
|
|
||||||
* define IPV6_CUSTOM_SCOPES to 1 and supply its own definitions for the three
|
|
||||||
* macros instead.
|
|
||||||
*/
|
|
||||||
#ifndef IPV6_CUSTOM_SCOPES
|
|
||||||
#define IPV6_CUSTOM_SCOPES 0
|
|
||||||
#endif /* !IPV6_CUSTOM_SCOPES */
|
|
||||||
|
|
||||||
#if !IPV6_CUSTOM_SCOPES
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether an IPv6 address has a constrained scope, and as such is
|
|
||||||
* meaningful only if accompanied by a zone index to identify the scope's zone.
|
|
||||||
* The given address type may be used to eliminate at compile time certain
|
|
||||||
* checks that will evaluate to false at run time anyway.
|
|
||||||
*
|
|
||||||
* This default implementation follows the default model of RFC 4007, where
|
|
||||||
* only interface-local and link-local scopes are defined.
|
|
||||||
*
|
|
||||||
* Even though the unicast loopback address does have an implied link-local
|
|
||||||
* scope, in this implementation it does not have an explicitly assigned zone
|
|
||||||
* index. As such it should not be tested for in this macro.
|
|
||||||
*
|
|
||||||
* @param ip6addr the IPv6 address (const); only its address part is examined.
|
|
||||||
* @param type address type; see @ref lwip_ipv6_scope_type.
|
|
||||||
* @return 1 if the address has a constrained scope, 0 if it does not.
|
|
||||||
*/
|
|
||||||
#define ip6_addr_has_scope(ip6addr, type) \
|
|
||||||
(ip6_addr_islinklocal(ip6addr) || (((type) != IP6_UNICAST) && \
|
|
||||||
(ip6_addr_ismulticast_iflocal(ip6addr) || \
|
|
||||||
ip6_addr_ismulticast_linklocal(ip6addr))))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Assign a zone index to an IPv6 address, based on a network interface. If the
|
|
||||||
* given address has a scope, the assigned zone index is that scope's zone of
|
|
||||||
* the given netif; otherwise, the assigned zone index is "no zone".
|
|
||||||
*
|
|
||||||
* This default implementation follows the default model of RFC 4007, where
|
|
||||||
* only interface-local and link-local scopes are defined, and the zone index
|
|
||||||
* of both of those scopes always equals the index of the network interface.
|
|
||||||
* As such, this default implementation need not distinguish between different
|
|
||||||
* constrained scopes when assigning the zone.
|
|
||||||
*
|
|
||||||
* @param ip6addr the IPv6 address; its address part is examined, and its zone
|
|
||||||
* index is assigned.
|
|
||||||
* @param type address type; see @ref lwip_ipv6_scope_type.
|
|
||||||
* @param netif the network interface (const).
|
|
||||||
*/
|
|
||||||
#define ip6_addr_assign_zone(ip6addr, type, netif) \
|
|
||||||
(ip6_addr_set_zone((ip6addr), \
|
|
||||||
ip6_addr_has_scope((ip6addr), (type)) ? netif_get_index(netif) : 0))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test whether an IPv6 address is "zone-compatible" with a network interface.
|
|
||||||
* That is, test whether the network interface is part of the zone associated
|
|
||||||
* with the address. For efficiency, this macro is only ever called if the
|
|
||||||
* given address is either scoped or zoned, and thus, it need not test this.
|
|
||||||
* If an address is scoped but not zoned, or zoned and not scoped, it is
|
|
||||||
* considered not zone-compatible with any netif.
|
|
||||||
*
|
|
||||||
* This default implementation follows the default model of RFC 4007, where
|
|
||||||
* only interface-local and link-local scopes are defined, and the zone index
|
|
||||||
* of both of those scopes always equals the index of the network interface.
|
|
||||||
* As such, there is always only one matching netif for a specific zone index,
|
|
||||||
* but all call sites of this macro currently support multiple matching netifs
|
|
||||||
* as well (at no additional expense in the common case).
|
|
||||||
*
|
|
||||||
* @param ip6addr the IPv6 address (const).
|
|
||||||
* @param netif the network interface (const).
|
|
||||||
* @return 1 if the address is scope-compatible with the netif, 0 if not.
|
|
||||||
*/
|
|
||||||
#define ip6_addr_test_zone(ip6addr, netif) \
|
|
||||||
(ip6_addr_equals_zone((ip6addr), netif_get_index(netif)))
|
|
||||||
|
|
||||||
#endif /* !IPV6_CUSTOM_SCOPES */
|
|
||||||
|
|
||||||
/** Does the given IPv6 address have a scope, and as such should also have a
|
|
||||||
* zone to be meaningful, but does not actually have a zone? (0/1) */
|
|
||||||
#define ip6_addr_lacks_zone(ip6addr, type) \
|
|
||||||
(!ip6_addr_has_zone(ip6addr) && ip6_addr_has_scope((ip6addr), (type)))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Try to select a zone for a scoped address that does not yet have a zone.
|
|
||||||
* Called from PCB bind and connect routines, for two reasons: 1) to save on
|
|
||||||
* this (relatively expensive) selection for every individual packet route
|
|
||||||
* operation and 2) to allow the application to obtain the selected zone from
|
|
||||||
* the PCB as is customary for e.g. getsockname/getpeername BSD socket calls.
|
|
||||||
*
|
|
||||||
* Ideally, callers would always supply a properly zoned address, in which case
|
|
||||||
* this function would not be needed. It exists both for compatibility with the
|
|
||||||
* BSD socket API (which accepts zoneless destination addresses) and for
|
|
||||||
* backward compatibility with pre-scoping lwIP code.
|
|
||||||
*
|
|
||||||
* It may be impossible to select a zone, e.g. if there are no netifs. In that
|
|
||||||
* case, the address's zone field will be left as is.
|
|
||||||
*
|
|
||||||
* @param dest the IPv6 address for which to select and set a zone.
|
|
||||||
* @param src source IPv6 address (const); may be equal to dest.
|
|
||||||
*/
|
|
||||||
#define ip6_addr_select_zone(dest, src) do { struct netif *selected_netif; \
|
|
||||||
selected_netif = ip6_route((src), (dest)); \
|
|
||||||
if (selected_netif != NULL) { \
|
|
||||||
ip6_addr_assign_zone((dest), IP6_UNKNOWN, selected_netif); \
|
|
||||||
} } while (0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#else /* LWIP_IPV6_SCOPES */
|
|
||||||
|
|
||||||
#define IPADDR6_ZONE_INIT
|
|
||||||
#define ip6_addr_zone(ip6addr) (IP6_NO_ZONE)
|
|
||||||
#define ip6_addr_has_zone(ip6addr) (0)
|
|
||||||
#define ip6_addr_set_zone(ip6addr, zone_idx)
|
|
||||||
#define ip6_addr_clear_zone(ip6addr)
|
|
||||||
#define ip6_addr_copy_zone(ip6addr1, ip6addr2)
|
|
||||||
#define ip6_addr_equals_zone(ip6addr, zone_idx) (1)
|
|
||||||
#define ip6_addr_cmp_zone(ip6addr1, ip6addr2) (1)
|
|
||||||
#define IPV6_CUSTOM_SCOPES 0
|
|
||||||
#define ip6_addr_has_scope(ip6addr, type) (0)
|
|
||||||
#define ip6_addr_assign_zone(ip6addr, type, netif)
|
|
||||||
#define ip6_addr_test_zone(ip6addr, netif) (1)
|
|
||||||
#define ip6_addr_lacks_zone(ip6addr, type) (0)
|
|
||||||
#define ip6_addr_select_zone(ip6addr, src)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6_SCOPES */
|
|
||||||
|
|
||||||
#if LWIP_IPV6_SCOPES && LWIP_IPV6_SCOPES_DEBUG
|
|
||||||
|
|
||||||
/** Verify that the given IPv6 address is properly zoned. */
|
|
||||||
#define IP6_ADDR_ZONECHECK(ip6addr) LWIP_ASSERT("IPv6 zone check failed", \
|
|
||||||
ip6_addr_has_scope(ip6addr, IP6_UNKNOWN) == ip6_addr_has_zone(ip6addr))
|
|
||||||
|
|
||||||
/** Verify that the given IPv6 address is properly zoned for the given netif. */
|
|
||||||
#define IP6_ADDR_ZONECHECK_NETIF(ip6addr, netif) LWIP_ASSERT("IPv6 netif zone check failed", \
|
|
||||||
ip6_addr_has_scope(ip6addr, IP6_UNKNOWN) ? \
|
|
||||||
(ip6_addr_has_zone(ip6addr) && \
|
|
||||||
(((netif) == NULL) || ip6_addr_test_zone((ip6addr), (netif)))) : \
|
|
||||||
!ip6_addr_has_zone(ip6addr))
|
|
||||||
|
|
||||||
#else /* LWIP_IPV6_SCOPES && LWIP_IPV6_SCOPES_DEBUG */
|
|
||||||
|
|
||||||
#define IP6_ADDR_ZONECHECK(ip6addr)
|
|
||||||
#define IP6_ADDR_ZONECHECK_NETIF(ip6addr, netif)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6_SCOPES && LWIP_IPV6_SCOPES_DEBUG */
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP6_ZONE_H */
|
|
||||||
-438
@@ -1,438 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* IP address API (common IPv4 and IPv6)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_IP_ADDR_H
|
|
||||||
#define LWIP_HDR_IP_ADDR_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/def.h"
|
|
||||||
|
|
||||||
#include "lwip/ip4_addr.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @ingroup ipaddr
|
|
||||||
* IP address types for use in ip_addr_t.type member.
|
|
||||||
* @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type().
|
|
||||||
*/
|
|
||||||
enum lwip_ip_addr_type {
|
|
||||||
/** IPv4 */
|
|
||||||
IPADDR_TYPE_V4 = 0U,
|
|
||||||
/** IPv6 */
|
|
||||||
IPADDR_TYPE_V6 = 6U,
|
|
||||||
/** IPv4+IPv6 ("dual-stack") */
|
|
||||||
IPADDR_TYPE_ANY = 46U
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
/**
|
|
||||||
* @ingroup ipaddr
|
|
||||||
* A union struct for both IP version's addresses.
|
|
||||||
* ATTENTION: watch out for its size when adding IPv6 address scope!
|
|
||||||
*/
|
|
||||||
typedef struct ip_addr {
|
|
||||||
union {
|
|
||||||
ip6_addr_t ip6;
|
|
||||||
ip4_addr_t ip4;
|
|
||||||
} u_addr;
|
|
||||||
/** @ref lwip_ip_addr_type */
|
|
||||||
u8_t type;
|
|
||||||
} ip_addr_t;
|
|
||||||
|
|
||||||
extern const ip_addr_t ip_addr_any_type;
|
|
||||||
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IPADDR4_INIT(u32val) { { { { u32val, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V4 }
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d)))
|
|
||||||
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IPADDR6_INIT(a, b, c, d) { { { { a, b, c, d } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 }
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 }
|
|
||||||
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define IP_IS_ANY_TYPE_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_ANY }
|
|
||||||
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IP_IS_V4_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IP_IS_V6_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IP_IS_V4(ipaddr) (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr)))
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IP_IS_V6(ipaddr) (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr)))
|
|
||||||
|
|
||||||
#define IP_SET_TYPE_VAL(ipaddr, iptype) do { (ipaddr).type = (iptype); }while(0)
|
|
||||||
#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0)
|
|
||||||
#define IP_GET_TYPE(ipaddr) ((ipaddr)->type)
|
|
||||||
|
|
||||||
#define IP_ADDR_RAW_SIZE(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4 ? sizeof(ip4_addr_t) : sizeof(ip6_addr_t))
|
|
||||||
|
|
||||||
#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) (IP_GET_TYPE(&pcb->local_ip) == IP_GET_TYPE(ipaddr))
|
|
||||||
#define IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr) (IP_IS_ANY_TYPE_VAL(pcb->local_ip) || IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr))
|
|
||||||
|
|
||||||
/** @ingroup ip6addr
|
|
||||||
* Convert generic ip address to specific protocol version
|
|
||||||
*/
|
|
||||||
#define ip_2_ip6(ipaddr) (&((ipaddr)->u_addr.ip6))
|
|
||||||
/** @ingroup ip4addr
|
|
||||||
* Convert generic ip address to specific protocol version
|
|
||||||
*/
|
|
||||||
#define ip_2_ip4(ipaddr) (&((ipaddr)->u_addr.ip4))
|
|
||||||
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IP_ADDR4(ipaddr,a,b,c,d) do { IP4_ADDR(ip_2_ip4(ipaddr),a,b,c,d); \
|
|
||||||
IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V4); } while(0)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IP_ADDR6(ipaddr,i0,i1,i2,i3) do { IP6_ADDR(ip_2_ip6(ipaddr),i0,i1,i2,i3); \
|
|
||||||
IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V6); } while(0)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3))
|
|
||||||
|
|
||||||
#define ip_clear_no4(ipaddr) do { ip_2_ip6(ipaddr)->addr[1] = \
|
|
||||||
ip_2_ip6(ipaddr)->addr[2] = \
|
|
||||||
ip_2_ip6(ipaddr)->addr[3] = 0; \
|
|
||||||
ip6_addr_clear_zone(ip_2_ip6(ipaddr)); }while(0)
|
|
||||||
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_copy(dest, src) do{ IP_SET_TYPE_VAL(dest, IP_GET_TYPE(&src)); if(IP_IS_V6_VAL(src)){ \
|
|
||||||
ip6_addr_copy(*ip_2_ip6(&(dest)), *ip_2_ip6(&(src))); }else{ \
|
|
||||||
ip4_addr_copy(*ip_2_ip4(&(dest)), *ip_2_ip4(&(src))); ip_clear_no4(&dest); }}while(0)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define ip_addr_copy_from_ip6(dest, src) do{ \
|
|
||||||
ip6_addr_copy(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define ip_addr_copy_from_ip6_packed(dest, src) do{ \
|
|
||||||
ip6_addr_copy_from_packed(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define ip_addr_copy_from_ip4(dest, src) do{ \
|
|
||||||
ip4_addr_copy(*ip_2_ip4(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V4); ip_clear_no4(&dest); }while(0)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define ip_addr_set_ip4_u32(ipaddr, val) do{if(ipaddr){ip4_addr_set_u32(ip_2_ip4(ipaddr), val); \
|
|
||||||
IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define ip_addr_set_ip4_u32_val(ipaddr, val) do{ ip4_addr_set_u32(ip_2_ip4(&(ipaddr)), val); \
|
|
||||||
IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }while(0)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define ip_addr_get_ip4_u32(ipaddr) (((ipaddr) && IP_IS_V4(ipaddr)) ? \
|
|
||||||
ip4_addr_get_u32(ip_2_ip4(ipaddr)) : 0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \
|
|
||||||
ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); }else{ \
|
|
||||||
ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); ip_clear_no4(dest); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_zero(ipaddr) do{ \
|
|
||||||
ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, 0); }while(0)
|
|
||||||
/** @ingroup ip5addr */
|
|
||||||
#define ip_addr_set_zero_ip4(ipaddr) do{ \
|
|
||||||
ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }while(0)
|
|
||||||
/** @ingroup ip6addr */
|
|
||||||
#define ip_addr_set_zero_ip6(ipaddr) do{ \
|
|
||||||
ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_any(is_ipv6, ipaddr) do{if(is_ipv6){ \
|
|
||||||
ip6_addr_set_any(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \
|
|
||||||
ip4_addr_set_any(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_any_val(is_ipv6, ipaddr) do{if(is_ipv6){ \
|
|
||||||
ip6_addr_set_any(ip_2_ip6(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V6); }else{ \
|
|
||||||
ip4_addr_set_any(ip_2_ip4(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_loopback(is_ipv6, ipaddr) do{if(is_ipv6){ \
|
|
||||||
ip6_addr_set_loopback(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \
|
|
||||||
ip4_addr_set_loopback(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_loopback_val(is_ipv6, ipaddr) do{if(is_ipv6){ \
|
|
||||||
ip6_addr_set_loopback(ip_2_ip6(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V6); }else{ \
|
|
||||||
ip4_addr_set_loopback(ip_2_ip4(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_set_hton(dest, src) do{if(IP_IS_V6(src)){ \
|
|
||||||
ip6_addr_set_hton(ip_2_ip6(dest), ip_2_ip6(src)); IP_SET_TYPE(dest, IPADDR_TYPE_V6); }else{ \
|
|
||||||
ip4_addr_set_hton(ip_2_ip4(dest), ip_2_ip4(src)); IP_SET_TYPE(dest, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_get_network(target, host, netmask) do{if(IP_IS_V6(host)){ \
|
|
||||||
ip4_addr_set_zero(ip_2_ip4(target)); IP_SET_TYPE(target, IPADDR_TYPE_V6); } else { \
|
|
||||||
ip4_addr_get_network(ip_2_ip4(target), ip_2_ip4(host), ip_2_ip4(netmask)); IP_SET_TYPE(target, IPADDR_TYPE_V4); }}while(0)
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_netcmp(addr1, addr2, mask) ((IP_IS_V6(addr1) && IP_IS_V6(addr2)) ? \
|
|
||||||
0 : \
|
|
||||||
ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_cmp(addr1, addr2) ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \
|
|
||||||
ip6_addr_cmp(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \
|
|
||||||
ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2))))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_cmp_zoneless(addr1, addr2) ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \
|
|
||||||
ip6_addr_cmp_zoneless(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \
|
|
||||||
ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2))))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_isany(ipaddr) (((ipaddr) == NULL) ? 1 : ((IP_IS_V6(ipaddr)) ? \
|
|
||||||
ip6_addr_isany(ip_2_ip6(ipaddr)) : \
|
|
||||||
ip4_addr_isany(ip_2_ip4(ipaddr))))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_isany_val(ipaddr) ((IP_IS_V6_VAL(ipaddr)) ? \
|
|
||||||
ip6_addr_isany_val(*ip_2_ip6(&(ipaddr))) : \
|
|
||||||
ip4_addr_isany_val(*ip_2_ip4(&(ipaddr))))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_isbroadcast(ipaddr, netif) ((IP_IS_V6(ipaddr)) ? \
|
|
||||||
0 : \
|
|
||||||
ip4_addr_isbroadcast(ip_2_ip4(ipaddr), netif))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_ismulticast(ipaddr) ((IP_IS_V6(ipaddr)) ? \
|
|
||||||
ip6_addr_ismulticast(ip_2_ip6(ipaddr)) : \
|
|
||||||
ip4_addr_ismulticast(ip_2_ip4(ipaddr)))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_isloopback(ipaddr) ((IP_IS_V6(ipaddr)) ? \
|
|
||||||
ip6_addr_isloopback(ip_2_ip6(ipaddr)) : \
|
|
||||||
ip4_addr_isloopback(ip_2_ip4(ipaddr)))
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip_addr_islinklocal(ipaddr) ((IP_IS_V6(ipaddr)) ? \
|
|
||||||
ip6_addr_islinklocal(ip_2_ip6(ipaddr)) : \
|
|
||||||
ip4_addr_islinklocal(ip_2_ip4(ipaddr)))
|
|
||||||
#define ip_addr_debug_print(debug, ipaddr) do { if(IP_IS_V6(ipaddr)) { \
|
|
||||||
ip6_addr_debug_print(debug, ip_2_ip6(ipaddr)); } else { \
|
|
||||||
ip4_addr_debug_print(debug, ip_2_ip4(ipaddr)); }}while(0)
|
|
||||||
#define ip_addr_debug_print_val(debug, ipaddr) do { if(IP_IS_V6_VAL(ipaddr)) { \
|
|
||||||
ip6_addr_debug_print_val(debug, *ip_2_ip6(&(ipaddr))); } else { \
|
|
||||||
ip4_addr_debug_print_val(debug, *ip_2_ip4(&(ipaddr))); }}while(0)
|
|
||||||
char *ipaddr_ntoa(const ip_addr_t *addr);
|
|
||||||
char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen);
|
|
||||||
int ipaddr_aton(const char *cp, ip_addr_t *addr);
|
|
||||||
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX
|
|
||||||
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) do { \
|
|
||||||
(ip6addr)->addr[3] = (ip4addr)->addr; \
|
|
||||||
(ip6addr)->addr[2] = PP_HTONL(0x0000FFFFUL); \
|
|
||||||
(ip6addr)->addr[1] = 0; \
|
|
||||||
(ip6addr)->addr[0] = 0; \
|
|
||||||
ip6_addr_clear_zone(ip6addr); } while(0);
|
|
||||||
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) \
|
|
||||||
(ip4addr)->addr = (ip6addr)->addr[3];
|
|
||||||
|
|
||||||
#define IP46_ADDR_ANY(type) (((type) == IPADDR_TYPE_V6)? IP6_ADDR_ANY : IP4_ADDR_ANY)
|
|
||||||
|
|
||||||
#else /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb) 1
|
|
||||||
#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) 1
|
|
||||||
|
|
||||||
#define ip_addr_set_any_val(is_ipv6, ipaddr) ip_addr_set_any(is_ipv6, &(ipaddr))
|
|
||||||
#define ip_addr_set_loopback_val(is_ipv6, ipaddr) ip_addr_set_loopback(is_ipv6, &(ipaddr))
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
typedef ip4_addr_t ip_addr_t;
|
|
||||||
#define IPADDR4_INIT(u32val) { u32val }
|
|
||||||
#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d)))
|
|
||||||
#define IP_IS_V4_VAL(ipaddr) 1
|
|
||||||
#define IP_IS_V6_VAL(ipaddr) 0
|
|
||||||
#define IP_IS_V4(ipaddr) 1
|
|
||||||
#define IP_IS_V6(ipaddr) 0
|
|
||||||
#define IP_IS_ANY_TYPE_VAL(ipaddr) 0
|
|
||||||
#define IP_SET_TYPE_VAL(ipaddr, iptype)
|
|
||||||
#define IP_SET_TYPE(ipaddr, iptype)
|
|
||||||
#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V4
|
|
||||||
#define IP_ADDR_RAW_SIZE(ipaddr) sizeof(ip4_addr_t)
|
|
||||||
#define ip_2_ip4(ipaddr) (ipaddr)
|
|
||||||
#define IP_ADDR4(ipaddr,a,b,c,d) IP4_ADDR(ipaddr,a,b,c,d)
|
|
||||||
|
|
||||||
#define ip_addr_copy(dest, src) ip4_addr_copy(dest, src)
|
|
||||||
#define ip_addr_copy_from_ip4(dest, src) ip4_addr_copy(dest, src)
|
|
||||||
#define ip_addr_set_ip4_u32(ipaddr, val) ip4_addr_set_u32(ip_2_ip4(ipaddr), val)
|
|
||||||
#define ip_addr_set_ip4_u32_val(ipaddr, val) ip_addr_set_ip4_u32(&(ipaddr), val)
|
|
||||||
#define ip_addr_get_ip4_u32(ipaddr) ip4_addr_get_u32(ip_2_ip4(ipaddr))
|
|
||||||
#define ip_addr_set(dest, src) ip4_addr_set(dest, src)
|
|
||||||
#define ip_addr_set_ipaddr(dest, src) ip4_addr_set(dest, src)
|
|
||||||
#define ip_addr_set_zero(ipaddr) ip4_addr_set_zero(ipaddr)
|
|
||||||
#define ip_addr_set_zero_ip4(ipaddr) ip4_addr_set_zero(ipaddr)
|
|
||||||
#define ip_addr_set_any(is_ipv6, ipaddr) ip4_addr_set_any(ipaddr)
|
|
||||||
#define ip_addr_set_loopback(is_ipv6, ipaddr) ip4_addr_set_loopback(ipaddr)
|
|
||||||
#define ip_addr_set_hton(dest, src) ip4_addr_set_hton(dest, src)
|
|
||||||
#define ip_addr_get_network(target, host, mask) ip4_addr_get_network(target, host, mask)
|
|
||||||
#define ip_addr_netcmp(addr1, addr2, mask) ip4_addr_netcmp(addr1, addr2, mask)
|
|
||||||
#define ip_addr_cmp(addr1, addr2) ip4_addr_cmp(addr1, addr2)
|
|
||||||
#define ip_addr_isany(ipaddr) ip4_addr_isany(ipaddr)
|
|
||||||
#define ip_addr_isany_val(ipaddr) ip4_addr_isany_val(ipaddr)
|
|
||||||
#define ip_addr_isloopback(ipaddr) ip4_addr_isloopback(ipaddr)
|
|
||||||
#define ip_addr_islinklocal(ipaddr) ip4_addr_islinklocal(ipaddr)
|
|
||||||
#define ip_addr_isbroadcast(addr, netif) ip4_addr_isbroadcast(addr, netif)
|
|
||||||
#define ip_addr_ismulticast(ipaddr) ip4_addr_ismulticast(ipaddr)
|
|
||||||
#define ip_addr_debug_print(debug, ipaddr) ip4_addr_debug_print(debug, ipaddr)
|
|
||||||
#define ip_addr_debug_print_val(debug, ipaddr) ip4_addr_debug_print_val(debug, ipaddr)
|
|
||||||
#define ipaddr_ntoa(ipaddr) ip4addr_ntoa(ipaddr)
|
|
||||||
#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip4addr_ntoa_r(ipaddr, buf, buflen)
|
|
||||||
#define ipaddr_aton(cp, addr) ip4addr_aton(cp, addr)
|
|
||||||
|
|
||||||
#define IPADDR_STRLEN_MAX IP4ADDR_STRLEN_MAX
|
|
||||||
|
|
||||||
#define IP46_ADDR_ANY(type) (IP4_ADDR_ANY)
|
|
||||||
|
|
||||||
#else /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
typedef ip6_addr_t ip_addr_t;
|
|
||||||
#define IPADDR6_INIT(a, b, c, d) { { a, b, c, d } IPADDR6_ZONE_INIT }
|
|
||||||
#define IPADDR6_INIT_HOST(a, b, c, d) { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT }
|
|
||||||
#define IP_IS_V4_VAL(ipaddr) 0
|
|
||||||
#define IP_IS_V6_VAL(ipaddr) 1
|
|
||||||
#define IP_IS_V4(ipaddr) 0
|
|
||||||
#define IP_IS_V6(ipaddr) 1
|
|
||||||
#define IP_IS_ANY_TYPE_VAL(ipaddr) 0
|
|
||||||
#define IP_SET_TYPE_VAL(ipaddr, iptype)
|
|
||||||
#define IP_SET_TYPE(ipaddr, iptype)
|
|
||||||
#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V6
|
|
||||||
#define IP_ADDR_RAW_SIZE(ipaddr) sizeof(ip6_addr_t)
|
|
||||||
#define ip_2_ip6(ipaddr) (ipaddr)
|
|
||||||
#define IP_ADDR6(ipaddr,i0,i1,i2,i3) IP6_ADDR(ipaddr,i0,i1,i2,i3)
|
|
||||||
#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3))
|
|
||||||
|
|
||||||
#define ip_addr_copy(dest, src) ip6_addr_copy(dest, src)
|
|
||||||
#define ip_addr_copy_from_ip6(dest, src) ip6_addr_copy(dest, src)
|
|
||||||
#define ip_addr_copy_from_ip6_packed(dest, src) ip6_addr_copy_from_packed(dest, src)
|
|
||||||
#define ip_addr_set(dest, src) ip6_addr_set(dest, src)
|
|
||||||
#define ip_addr_set_ipaddr(dest, src) ip6_addr_set(dest, src)
|
|
||||||
#define ip_addr_set_zero(ipaddr) ip6_addr_set_zero(ipaddr)
|
|
||||||
#define ip_addr_set_zero_ip6(ipaddr) ip6_addr_set_zero(ipaddr)
|
|
||||||
#define ip_addr_set_any(is_ipv6, ipaddr) ip6_addr_set_any(ipaddr)
|
|
||||||
#define ip_addr_set_loopback(is_ipv6, ipaddr) ip6_addr_set_loopback(ipaddr)
|
|
||||||
#define ip_addr_set_hton(dest, src) ip6_addr_set_hton(dest, src)
|
|
||||||
#define ip_addr_get_network(target, host, mask) ip6_addr_set_zero(target)
|
|
||||||
#define ip_addr_netcmp(addr1, addr2, mask) 0
|
|
||||||
#define ip_addr_cmp(addr1, addr2) ip6_addr_cmp(addr1, addr2)
|
|
||||||
#define ip_addr_cmp_zoneless(addr1, addr2) ip6_addr_cmp_zoneless(addr1, addr2)
|
|
||||||
#define ip_addr_isany(ipaddr) ip6_addr_isany(ipaddr)
|
|
||||||
#define ip_addr_isany_val(ipaddr) ip6_addr_isany_val(ipaddr)
|
|
||||||
#define ip_addr_isloopback(ipaddr) ip6_addr_isloopback(ipaddr)
|
|
||||||
#define ip_addr_islinklocal(ipaddr) ip6_addr_islinklocal(ipaddr)
|
|
||||||
#define ip_addr_isbroadcast(addr, netif) 0
|
|
||||||
#define ip_addr_ismulticast(ipaddr) ip6_addr_ismulticast(ipaddr)
|
|
||||||
#define ip_addr_debug_print(debug, ipaddr) ip6_addr_debug_print(debug, ipaddr)
|
|
||||||
#define ip_addr_debug_print_val(debug, ipaddr) ip6_addr_debug_print_val(debug, ipaddr)
|
|
||||||
#define ipaddr_ntoa(ipaddr) ip6addr_ntoa(ipaddr)
|
|
||||||
#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip6addr_ntoa_r(ipaddr, buf, buflen)
|
|
||||||
#define ipaddr_aton(cp, addr) ip6addr_aton(cp, addr)
|
|
||||||
|
|
||||||
#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX
|
|
||||||
|
|
||||||
#define IP46_ADDR_ANY(type) (IP6_ADDR_ANY)
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
|
|
||||||
extern const ip_addr_t ip_addr_any;
|
|
||||||
extern const ip_addr_t ip_addr_broadcast;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup ip4addr
|
|
||||||
* Can be used as a fixed/const ip_addr_t
|
|
||||||
* for the IP wildcard.
|
|
||||||
* Defined to @ref IP4_ADDR_ANY when IPv4 is enabled.
|
|
||||||
* Defined to @ref IP6_ADDR_ANY in IPv6 only systems.
|
|
||||||
* Use this if you can handle IPv4 _AND_ IPv6 addresses.
|
|
||||||
* Use @ref IP4_ADDR_ANY or @ref IP6_ADDR_ANY when the IP
|
|
||||||
* type matters.
|
|
||||||
*/
|
|
||||||
#define IP_ADDR_ANY IP4_ADDR_ANY
|
|
||||||
/**
|
|
||||||
* @ingroup ip4addr
|
|
||||||
* Can be used as a fixed/const ip_addr_t
|
|
||||||
* for the IPv4 wildcard and the broadcast address
|
|
||||||
*/
|
|
||||||
#define IP4_ADDR_ANY (&ip_addr_any)
|
|
||||||
/**
|
|
||||||
* @ingroup ip4addr
|
|
||||||
* Can be used as a fixed/const ip4_addr_t
|
|
||||||
* for the wildcard and the broadcast address
|
|
||||||
*/
|
|
||||||
#define IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any))
|
|
||||||
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IP_ADDR_BROADCAST (&ip_addr_broadcast)
|
|
||||||
/** @ingroup ip4addr */
|
|
||||||
#define IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast))
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV4*/
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
|
|
||||||
extern const ip_addr_t ip6_addr_any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup ip6addr
|
|
||||||
* IP6_ADDR_ANY can be used as a fixed ip_addr_t
|
|
||||||
* for the IPv6 wildcard address
|
|
||||||
*/
|
|
||||||
#define IP6_ADDR_ANY (&ip6_addr_any)
|
|
||||||
/**
|
|
||||||
* @ingroup ip6addr
|
|
||||||
* IP6_ADDR_ANY6 can be used as a fixed ip6_addr_t
|
|
||||||
* for the IPv6 wildcard address
|
|
||||||
*/
|
|
||||||
#define IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any))
|
|
||||||
|
|
||||||
#if !LWIP_IPV4
|
|
||||||
/** IPv6-only configurations */
|
|
||||||
#define IP_ADDR_ANY IP6_ADDR_ANY
|
|
||||||
#endif /* !LWIP_IPV4 */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
/** @ingroup ipaddr */
|
|
||||||
#define IP_ANY_TYPE (&ip_addr_any_type)
|
|
||||||
#else
|
|
||||||
#define IP_ANY_TYPE IP_ADDR_ANY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_ADDR_H */
|
|
||||||
-82
@@ -1,82 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Heap API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_MEM_H
|
|
||||||
#define LWIP_HDR_MEM_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MEM_LIBC_MALLOC
|
|
||||||
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
|
|
||||||
typedef size_t mem_size_t;
|
|
||||||
#define MEM_SIZE_F SZT_F
|
|
||||||
|
|
||||||
#elif MEM_USE_POOLS
|
|
||||||
|
|
||||||
typedef u16_t mem_size_t;
|
|
||||||
#define MEM_SIZE_F U16_F
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* MEM_SIZE would have to be aligned, but using 64000 here instead of
|
|
||||||
* 65535 leaves some room for alignment...
|
|
||||||
*/
|
|
||||||
#if MEM_SIZE > 64000L
|
|
||||||
typedef u32_t mem_size_t;
|
|
||||||
#define MEM_SIZE_F U32_F
|
|
||||||
#else
|
|
||||||
typedef u16_t mem_size_t;
|
|
||||||
#define MEM_SIZE_F U16_F
|
|
||||||
#endif /* MEM_SIZE > 64000 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void mem_init(void);
|
|
||||||
void *mem_trim(void *mem, mem_size_t size);
|
|
||||||
void *mem_malloc(mem_size_t size);
|
|
||||||
void *mem_calloc(mem_size_t count, mem_size_t size);
|
|
||||||
void mem_free(void *mem);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MEM_H */
|
|
||||||
-155
@@ -1,155 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Memory pool API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_MEMP_H
|
|
||||||
#define LWIP_HDR_MEMP_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* run once with empty definition to handle all custom includes in lwippools.h */
|
|
||||||
#define LWIP_MEMPOOL(name,num,size,desc)
|
|
||||||
#include "lwip/priv/memp_std.h"
|
|
||||||
|
|
||||||
/** Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */
|
|
||||||
typedef enum {
|
|
||||||
#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
|
|
||||||
#include "lwip/priv/memp_std.h"
|
|
||||||
MEMP_MAX
|
|
||||||
} memp_t;
|
|
||||||
|
|
||||||
#include "lwip/priv/memp_priv.h"
|
|
||||||
#include "lwip/stats.h"
|
|
||||||
|
|
||||||
extern const struct memp_desc* const memp_pools[MEMP_MAX];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mempool
|
|
||||||
* Declare prototype for private memory pool if it is used in multiple files
|
|
||||||
*/
|
|
||||||
#define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name
|
|
||||||
|
|
||||||
#if MEMP_MEM_MALLOC
|
|
||||||
|
|
||||||
#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
|
|
||||||
LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
|
|
||||||
const struct memp_desc memp_ ## name = { \
|
|
||||||
DECLARE_LWIP_MEMPOOL_DESC(desc) \
|
|
||||||
LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
|
|
||||||
LWIP_MEM_ALIGN_SIZE(size) \
|
|
||||||
};
|
|
||||||
|
|
||||||
#else /* MEMP_MEM_MALLOC */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mempool
|
|
||||||
* Declare a private memory pool
|
|
||||||
* Private mempools example:
|
|
||||||
* .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool);
|
|
||||||
* .c:
|
|
||||||
* - in global variables section: LWIP_MEMPOOL_DECLARE(my_private_pool, 10, sizeof(foo), "Some description")
|
|
||||||
* - call ONCE before using pool (e.g. in some init() function): LWIP_MEMPOOL_INIT(my_private_pool);
|
|
||||||
* - allocate: void* my_new_mem = LWIP_MEMPOOL_ALLOC(my_private_pool);
|
|
||||||
* - free: LWIP_MEMPOOL_FREE(my_private_pool, my_new_mem);
|
|
||||||
*
|
|
||||||
* To relocate a pool, declare it as extern in cc.h. Example for GCC:
|
|
||||||
* extern u8_t \_\_attribute\_\_((section(".onchip_mem"))) memp_memory_my_private_pool_base[];
|
|
||||||
*/
|
|
||||||
#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
|
|
||||||
LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \
|
|
||||||
\
|
|
||||||
LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
|
|
||||||
\
|
|
||||||
static struct memp *memp_tab_ ## name; \
|
|
||||||
\
|
|
||||||
const struct memp_desc memp_ ## name = { \
|
|
||||||
DECLARE_LWIP_MEMPOOL_DESC(desc) \
|
|
||||||
LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
|
|
||||||
LWIP_MEM_ALIGN_SIZE(size), \
|
|
||||||
(num), \
|
|
||||||
memp_memory_ ## name ## _base, \
|
|
||||||
&memp_tab_ ## name \
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* MEMP_MEM_MALLOC */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup mempool
|
|
||||||
* Initialize a private memory pool
|
|
||||||
*/
|
|
||||||
#define LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name)
|
|
||||||
/**
|
|
||||||
* @ingroup mempool
|
|
||||||
* Allocate from a private memory pool
|
|
||||||
*/
|
|
||||||
#define LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name)
|
|
||||||
/**
|
|
||||||
* @ingroup mempool
|
|
||||||
* Free element from a private memory pool
|
|
||||||
*/
|
|
||||||
#define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x))
|
|
||||||
|
|
||||||
#if MEM_USE_POOLS
|
|
||||||
/** This structure is used to save the pool one element came from.
|
|
||||||
* This has to be defined here as it is required for pool size calculation. */
|
|
||||||
struct memp_malloc_helper
|
|
||||||
{
|
|
||||||
memp_t poolnr;
|
|
||||||
#if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS)
|
|
||||||
u16_t size;
|
|
||||||
#endif /* MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) */
|
|
||||||
};
|
|
||||||
#endif /* MEM_USE_POOLS */
|
|
||||||
|
|
||||||
void memp_init(void);
|
|
||||||
|
|
||||||
#if MEMP_OVERFLOW_CHECK
|
|
||||||
void *memp_malloc_fn(memp_t type, const char* file, const int line);
|
|
||||||
#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
|
|
||||||
#else
|
|
||||||
void *memp_malloc(memp_t type);
|
|
||||||
#endif
|
|
||||||
void memp_free(memp_t type, void *mem);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MEMP_H */
|
|
||||||
-99
@@ -1,99 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710.
|
|
||||||
* No support for MLDv2.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_MLD6_H
|
|
||||||
#define LWIP_HDR_MLD6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** MLD group */
|
|
||||||
struct mld_group {
|
|
||||||
/** next link */
|
|
||||||
struct mld_group *next;
|
|
||||||
/** multicast address */
|
|
||||||
ip6_addr_t group_address;
|
|
||||||
/** signifies we were the last person to report */
|
|
||||||
u8_t last_reporter_flag;
|
|
||||||
/** current state of the group */
|
|
||||||
u8_t group_state;
|
|
||||||
/** timer for reporting */
|
|
||||||
u16_t timer;
|
|
||||||
/** counter of simultaneous uses */
|
|
||||||
u8_t use;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define MLD6_TMR_INTERVAL 100 /* Milliseconds */
|
|
||||||
|
|
||||||
err_t mld6_stop(struct netif *netif);
|
|
||||||
void mld6_report_groups(struct netif *netif);
|
|
||||||
void mld6_tmr(void);
|
|
||||||
struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr);
|
|
||||||
void mld6_input(struct pbuf *p, struct netif *inp);
|
|
||||||
err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
|
|
||||||
err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);
|
|
||||||
err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
|
|
||||||
err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);
|
|
||||||
|
|
||||||
/** @ingroup mld6
|
|
||||||
* Get list head of MLD6 groups for netif.
|
|
||||||
* Note: The allnodes group IP is NOT in the list, since it must always
|
|
||||||
* be received for correct IPv6 operation.
|
|
||||||
* @see @ref netif_set_mld_mac_filter()
|
|
||||||
*/
|
|
||||||
#define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6_MLD && LWIP_IPV6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MLD6_H */
|
|
||||||
-90
@@ -1,90 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* Neighbor discovery and stateless address autoconfiguration for IPv6.
|
|
||||||
* Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862
|
|
||||||
* (Address autoconfiguration).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_ND6_H
|
|
||||||
#define LWIP_HDR_ND6_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** 1 second period */
|
|
||||||
#define ND6_TMR_INTERVAL 1000
|
|
||||||
|
|
||||||
/** Router solicitations are sent in 4 second intervals (see RFC 4861, ch. 6.3.7) */
|
|
||||||
#ifndef ND6_RTR_SOLICITATION_INTERVAL
|
|
||||||
#define ND6_RTR_SOLICITATION_INTERVAL 4000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct pbuf;
|
|
||||||
struct netif;
|
|
||||||
|
|
||||||
void nd6_tmr(void);
|
|
||||||
void nd6_input(struct pbuf *p, struct netif *inp);
|
|
||||||
void nd6_clear_destination_cache(void);
|
|
||||||
struct netif *nd6_find_route(const ip6_addr_t *ip6addr);
|
|
||||||
err_t nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp);
|
|
||||||
u16_t nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif);
|
|
||||||
#if LWIP_ND6_TCP_REACHABILITY_HINTS
|
|
||||||
void nd6_reachability_hint(const ip6_addr_t *ip6addr);
|
|
||||||
#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */
|
|
||||||
void nd6_cleanup_netif(struct netif *netif);
|
|
||||||
#if LWIP_IPV6_MLD
|
|
||||||
void nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state);
|
|
||||||
#endif /* LWIP_IPV6_MLD */
|
|
||||||
void nd6_restart_netif(struct netif *netif);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ND6_H */
|
|
||||||
-121
@@ -1,121 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* netbuf API (for netconn API)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_NETBUF_H
|
|
||||||
#define LWIP_HDR_NETBUF_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
/* Note: Netconn API is always available when sockets are enabled -
|
|
||||||
* sockets are implemented on top of them */
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** This netbuf has dest-addr/port set */
|
|
||||||
#define NETBUF_FLAG_DESTADDR 0x01
|
|
||||||
/** This netbuf includes a checksum */
|
|
||||||
#define NETBUF_FLAG_CHKSUM 0x02
|
|
||||||
#if LWIP_UDP_OPT_BLOCK_TX_TILL_COMPLETE
|
|
||||||
#define NETBUF_FLAG_UDP_BLOCL_TX_TILL_COMPLETE 0x04
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** "Network buffer" - contains data and addressing info */
|
|
||||||
struct netbuf {
|
|
||||||
struct pbuf *p, *ptr;
|
|
||||||
ip_addr_t addr;
|
|
||||||
u16_t port;
|
|
||||||
#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY || LWIP_UDP_OPT_BLOCK_TX_TILL_COMPLETE
|
|
||||||
u8_t flags;
|
|
||||||
#endif
|
|
||||||
#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY
|
|
||||||
u16_t toport_chksum;
|
|
||||||
#if LWIP_NETBUF_RECVINFO
|
|
||||||
ip_addr_t toaddr;
|
|
||||||
#endif /* LWIP_NETBUF_RECVINFO */
|
|
||||||
#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Network buffer functions: */
|
|
||||||
struct netbuf * netbuf_new (void);
|
|
||||||
void netbuf_delete (struct netbuf *buf);
|
|
||||||
void * netbuf_alloc (struct netbuf *buf, u16_t size);
|
|
||||||
void netbuf_free (struct netbuf *buf);
|
|
||||||
err_t netbuf_ref (struct netbuf *buf,
|
|
||||||
const void *dataptr, u16_t size);
|
|
||||||
void netbuf_chain (struct netbuf *head, struct netbuf *tail);
|
|
||||||
|
|
||||||
err_t netbuf_data (struct netbuf *buf,
|
|
||||||
void **dataptr, u16_t *len);
|
|
||||||
s8_t netbuf_next (struct netbuf *buf);
|
|
||||||
void netbuf_first (struct netbuf *buf);
|
|
||||||
|
|
||||||
|
|
||||||
#define netbuf_copy_partial(buf, dataptr, len, offset) \
|
|
||||||
pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
|
|
||||||
#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)
|
|
||||||
#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len)
|
|
||||||
#define netbuf_len(buf) ((buf)->p->tot_len)
|
|
||||||
#define netbuf_fromaddr(buf) (&((buf)->addr))
|
|
||||||
#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set(&((buf)->addr), fromaddr)
|
|
||||||
#define netbuf_fromport(buf) ((buf)->port)
|
|
||||||
#if LWIP_NETBUF_RECVINFO
|
|
||||||
#define netbuf_destaddr(buf) (&((buf)->toaddr))
|
|
||||||
#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr)
|
|
||||||
#if LWIP_CHECKSUM_ON_COPY
|
|
||||||
#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0)
|
|
||||||
#else /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
#define netbuf_destport(buf) ((buf)->toport_chksum)
|
|
||||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
#endif /* LWIP_NETBUF_RECVINFO */
|
|
||||||
#if LWIP_CHECKSUM_ON_COPY
|
|
||||||
#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \
|
|
||||||
(buf)->toport_chksum = chksum; } while(0)
|
|
||||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_NETCONN || LWIP_SOCKET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETBUF_H */
|
|
||||||
-150
@@ -1,150 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* NETDB API (sockets)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_NETDB_H
|
|
||||||
#define LWIP_HDR_NETDB_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_DNS && LWIP_SOCKET
|
|
||||||
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
#include "lwip/inet.h"
|
|
||||||
#include "lwip/sockets.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* some rarely used options */
|
|
||||||
#ifndef LWIP_DNS_API_DECLARE_H_ERRNO
|
|
||||||
#define LWIP_DNS_API_DECLARE_H_ERRNO 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_DNS_API_DEFINE_ERRORS
|
|
||||||
#define LWIP_DNS_API_DEFINE_ERRORS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_DNS_API_DEFINE_FLAGS
|
|
||||||
#define LWIP_DNS_API_DEFINE_FLAGS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWIP_DNS_API_DECLARE_STRUCTS
|
|
||||||
#define LWIP_DNS_API_DECLARE_STRUCTS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_DNS_API_DEFINE_ERRORS
|
|
||||||
/** Errors used by the DNS API functions, h_errno can be one of them */
|
|
||||||
#define EAI_NONAME 200
|
|
||||||
#define EAI_SERVICE 201
|
|
||||||
#define EAI_FAIL 202
|
|
||||||
#define EAI_MEMORY 203
|
|
||||||
#define EAI_FAMILY 204
|
|
||||||
|
|
||||||
#define HOST_NOT_FOUND 210
|
|
||||||
#define NO_DATA 211
|
|
||||||
#define NO_RECOVERY 212
|
|
||||||
#define TRY_AGAIN 213
|
|
||||||
#endif /* LWIP_DNS_API_DEFINE_ERRORS */
|
|
||||||
|
|
||||||
#if LWIP_DNS_API_DEFINE_FLAGS
|
|
||||||
/* input flags for struct addrinfo */
|
|
||||||
#define AI_PASSIVE 0x01
|
|
||||||
#define AI_CANONNAME 0x02
|
|
||||||
#define AI_NUMERICHOST 0x04
|
|
||||||
#define AI_NUMERICSERV 0x08
|
|
||||||
#define AI_V4MAPPED 0x10
|
|
||||||
#define AI_ALL 0x20
|
|
||||||
#define AI_ADDRCONFIG 0x40
|
|
||||||
#endif /* LWIP_DNS_API_DEFINE_FLAGS */
|
|
||||||
|
|
||||||
#if LWIP_DNS_API_DECLARE_STRUCTS
|
|
||||||
struct hostent {
|
|
||||||
char *h_name; /* Official name of the host. */
|
|
||||||
char **h_aliases; /* A pointer to an array of pointers to alternative host names,
|
|
||||||
terminated by a null pointer. */
|
|
||||||
int h_addrtype; /* Address type. */
|
|
||||||
int h_length; /* The length, in bytes, of the address. */
|
|
||||||
char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
|
|
||||||
network byte order) for the host, terminated by a null pointer. */
|
|
||||||
#define h_addr h_addr_list[0] /* for backward compatibility */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct addrinfo {
|
|
||||||
int ai_flags; /* Input flags. */
|
|
||||||
int ai_family; /* Address family of socket. */
|
|
||||||
int ai_socktype; /* Socket type. */
|
|
||||||
int ai_protocol; /* Protocol of socket. */
|
|
||||||
socklen_t ai_addrlen; /* Length of socket address. */
|
|
||||||
struct sockaddr *ai_addr; /* Socket address of socket. */
|
|
||||||
char *ai_canonname; /* Canonical name of service location. */
|
|
||||||
struct addrinfo *ai_next; /* Pointer to next in list. */
|
|
||||||
};
|
|
||||||
#endif /* LWIP_DNS_API_DECLARE_STRUCTS */
|
|
||||||
|
|
||||||
#define NETDB_ELEM_SIZE (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1)
|
|
||||||
|
|
||||||
#if LWIP_DNS_API_DECLARE_H_ERRNO
|
|
||||||
/* application accessible error code set by the DNS API functions */
|
|
||||||
extern int h_errno;
|
|
||||||
#endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/
|
|
||||||
|
|
||||||
struct hostent *lwip_gethostbyname(const char *name);
|
|
||||||
int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
|
||||||
size_t buflen, struct hostent **result, int *h_errnop);
|
|
||||||
void lwip_freeaddrinfo(struct addrinfo *ai);
|
|
||||||
int lwip_getaddrinfo(const char *nodename,
|
|
||||||
const char *servname,
|
|
||||||
const struct addrinfo *hints,
|
|
||||||
struct addrinfo **res);
|
|
||||||
|
|
||||||
#if LWIP_COMPAT_SOCKETS
|
|
||||||
/** @ingroup netdbapi */
|
|
||||||
#define gethostbyname(name) lwip_gethostbyname(name)
|
|
||||||
/** @ingroup netdbapi */
|
|
||||||
#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
|
|
||||||
lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
|
|
||||||
/** @ingroup netdbapi */
|
|
||||||
#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
|
|
||||||
/** @ingroup netdbapi */
|
|
||||||
#define getaddrinfo(nodname, servname, hints, res) \
|
|
||||||
lwip_getaddrinfo(nodname, servname, hints, res)
|
|
||||||
#endif /* LWIP_COMPAT_SOCKETS */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_DNS && LWIP_SOCKET */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETDB_H */
|
|
||||||
-686
@@ -1,686 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* netif API (to be used from TCPIP thread)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_NETIF_H
|
|
||||||
#define LWIP_HDR_NETIF_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
|
|
||||||
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#include "lwip/def.h"
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/stats.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Throughout this file, IP addresses are expected to be in
|
|
||||||
* the same byte order as in IP_PCB. */
|
|
||||||
|
|
||||||
/** Must be the maximum of all used hardware address lengths
|
|
||||||
across all types of interfaces in use.
|
|
||||||
This does not have to be changed, normally. */
|
|
||||||
#ifndef NETIF_MAX_HWADDR_LEN
|
|
||||||
#define NETIF_MAX_HWADDR_LEN 6U
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The size of a fully constructed netif name which the
|
|
||||||
* netif can be identified by in APIs. Composed of
|
|
||||||
* 2 chars, 3 (max) digits, and 1 \0
|
|
||||||
*/
|
|
||||||
#define NETIF_NAMESIZE 6
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup netif_flags Flags
|
|
||||||
* @ingroup netif
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Whether the network interface is 'up'. This is
|
|
||||||
* a software flag used to control whether this network
|
|
||||||
* interface is enabled and processes traffic.
|
|
||||||
* It must be set by the startup code before this netif can be used
|
|
||||||
* (also for dhcp/autoip).
|
|
||||||
*/
|
|
||||||
#define NETIF_FLAG_UP 0x01U
|
|
||||||
/** If set, the netif has broadcast capability.
|
|
||||||
* Set by the netif driver in its init function. */
|
|
||||||
#define NETIF_FLAG_BROADCAST 0x02U
|
|
||||||
/** If set, the interface has an active link
|
|
||||||
* (set by the network interface driver).
|
|
||||||
* Either set by the netif driver in its init function (if the link
|
|
||||||
* is up at that time) or at a later point once the link comes up
|
|
||||||
* (if link detection is supported by the hardware). */
|
|
||||||
#define NETIF_FLAG_LINK_UP 0x04U
|
|
||||||
/** If set, the netif is an ethernet device using ARP.
|
|
||||||
* Set by the netif driver in its init function.
|
|
||||||
* Used to check input packet types and use of DHCP. */
|
|
||||||
#define NETIF_FLAG_ETHARP 0x08U
|
|
||||||
/** If set, the netif is an ethernet device. It might not use
|
|
||||||
* ARP or TCP/IP if it is used for PPPoE only.
|
|
||||||
*/
|
|
||||||
#define NETIF_FLAG_ETHERNET 0x10U
|
|
||||||
/** If set, the netif has IGMP capability.
|
|
||||||
* Set by the netif driver in its init function. */
|
|
||||||
#define NETIF_FLAG_IGMP 0x20U
|
|
||||||
/** If set, the netif has MLD6 capability.
|
|
||||||
* Set by the netif driver in its init function. */
|
|
||||||
#define NETIF_FLAG_MLD6 0x40U
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
#if LWIP_UDP_OPT_BLOCK_TX_TILL_COMPLETE
|
|
||||||
#define NETIF_ENABLE_BLOCKING_TX_FOR_PACKET 0x20
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum lwip_internal_netif_client_data_index
|
|
||||||
{
|
|
||||||
#if LWIP_IPV4
|
|
||||||
#if LWIP_DHCP
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_DHCP,
|
|
||||||
#endif
|
|
||||||
#if LWIP_AUTOIP
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP,
|
|
||||||
#endif
|
|
||||||
#if LWIP_IGMP
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_IGMP,
|
|
||||||
#endif
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#if LWIP_IPV6
|
|
||||||
#if LWIP_IPV6_DHCP6
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6,
|
|
||||||
#endif
|
|
||||||
#if LWIP_IPV6_MLD
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_MLD6,
|
|
||||||
#endif
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
LWIP_NETIF_CLIENT_DATA_INDEX_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_CHECKSUM_CTRL_PER_NETIF
|
|
||||||
#define NETIF_CHECKSUM_GEN_IP 0x0001
|
|
||||||
#define NETIF_CHECKSUM_GEN_UDP 0x0002
|
|
||||||
#define NETIF_CHECKSUM_GEN_TCP 0x0004
|
|
||||||
#define NETIF_CHECKSUM_GEN_ICMP 0x0008
|
|
||||||
#define NETIF_CHECKSUM_GEN_ICMP6 0x0010
|
|
||||||
#define NETIF_CHECKSUM_CHECK_IP 0x0100
|
|
||||||
#define NETIF_CHECKSUM_CHECK_UDP 0x0200
|
|
||||||
#define NETIF_CHECKSUM_CHECK_TCP 0x0400
|
|
||||||
#define NETIF_CHECKSUM_CHECK_ICMP 0x0800
|
|
||||||
#define NETIF_CHECKSUM_CHECK_ICMP6 0x1000
|
|
||||||
#define NETIF_CHECKSUM_ENABLE_ALL 0xFFFF
|
|
||||||
#define NETIF_CHECKSUM_DISABLE_ALL 0x0000
|
|
||||||
#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */
|
|
||||||
|
|
||||||
struct netif;
|
|
||||||
|
|
||||||
/** MAC Filter Actions, these are passed to a netif's igmp_mac_filter or
|
|
||||||
* mld_mac_filter callback function. */
|
|
||||||
enum netif_mac_filter_action {
|
|
||||||
/** Delete a filter entry */
|
|
||||||
NETIF_DEL_MAC_FILTER = 0,
|
|
||||||
/** Add a filter entry */
|
|
||||||
NETIF_ADD_MAC_FILTER = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Function prototype for netif init functions. Set up flags and output/linkoutput
|
|
||||||
* callback functions in this function.
|
|
||||||
*
|
|
||||||
* @param netif The netif to initialize
|
|
||||||
*/
|
|
||||||
typedef err_t (*netif_init_fn)(struct netif *netif);
|
|
||||||
/** Function prototype for netif->input functions. This function is saved as 'input'
|
|
||||||
* callback function in the netif struct. Call it when a packet has been received.
|
|
||||||
*
|
|
||||||
* @param p The received packet, copied into a pbuf
|
|
||||||
* @param inp The netif which received the packet
|
|
||||||
* @return ERR_OK if the packet was handled
|
|
||||||
* != ERR_OK is the packet was NOT handled, in this case, the caller has
|
|
||||||
* to free the pbuf
|
|
||||||
*/
|
|
||||||
typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp);
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
/** Function prototype for netif->output functions. Called by lwIP when a packet
|
|
||||||
* shall be sent. For ethernet netif, set this to 'etharp_output' and set
|
|
||||||
* 'linkoutput'.
|
|
||||||
*
|
|
||||||
* @param netif The netif which shall send a packet
|
|
||||||
* @param p The packet to send (p->payload points to IP header)
|
|
||||||
* @param ipaddr The IP address to which the packet shall be sent
|
|
||||||
*/
|
|
||||||
typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
|
|
||||||
const ip4_addr_t *ipaddr);
|
|
||||||
#endif /* LWIP_IPV4*/
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** Function prototype for netif->output_ip6 functions. Called by lwIP when a packet
|
|
||||||
* shall be sent. For ethernet netif, set this to 'ethip6_output' and set
|
|
||||||
* 'linkoutput'.
|
|
||||||
*
|
|
||||||
* @param netif The netif which shall send a packet
|
|
||||||
* @param p The packet to send (p->payload points to IP header)
|
|
||||||
* @param ipaddr The IPv6 address to which the packet shall be sent
|
|
||||||
*/
|
|
||||||
typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p,
|
|
||||||
const ip6_addr_t *ipaddr);
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
/** Function prototype for netif->linkoutput functions. Only used for ethernet
|
|
||||||
* netifs. This function is called by ARP when a packet shall be sent.
|
|
||||||
*
|
|
||||||
* @param netif The netif which shall send a packet
|
|
||||||
* @param p The packet to send (raw ethernet packet)
|
|
||||||
*/
|
|
||||||
typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
|
|
||||||
/** Function prototype for netif status- or link-callback functions. */
|
|
||||||
typedef void (*netif_status_callback_fn)(struct netif *netif);
|
|
||||||
#if LWIP_IPV4 && LWIP_IGMP
|
|
||||||
/** Function prototype for netif igmp_mac_filter functions */
|
|
||||||
typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
|
|
||||||
const ip4_addr_t *group, enum netif_mac_filter_action action);
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IGMP */
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
|
||||||
/** Function prototype for netif mld_mac_filter functions */
|
|
||||||
typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
|
|
||||||
const ip6_addr_t *group, enum netif_mac_filter_action action);
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
|
||||||
|
|
||||||
#if LWIP_DHCP || LWIP_AUTOIP || LWIP_IGMP || LWIP_IPV6_MLD || LWIP_IPV6_DHCP6 || (LWIP_NUM_NETIF_CLIENT_DATA > 0)
|
|
||||||
#if LWIP_NUM_NETIF_CLIENT_DATA > 0
|
|
||||||
u8_t netif_alloc_client_data_id(void);
|
|
||||||
#endif
|
|
||||||
/** @ingroup netif_cd
|
|
||||||
* Set client data. Obtain ID from netif_alloc_client_data_id().
|
|
||||||
*/
|
|
||||||
#define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data)
|
|
||||||
/** @ingroup netif_cd
|
|
||||||
* Get client data. Obtain ID from netif_alloc_client_data_id().
|
|
||||||
*/
|
|
||||||
#define netif_get_client_data(netif, id) (netif)->client_data[(id)]
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LWIP_IPV4 && LWIP_ARP && (ARP_TABLE_SIZE > 0x7f)) || (LWIP_IPV6 && (LWIP_ND6_NUM_DESTINATIONS > 0x7f))
|
|
||||||
typedef u16_t netif_addr_idx_t;
|
|
||||||
#define NETIF_ADDR_IDX_MAX 0x7FFF
|
|
||||||
#else
|
|
||||||
typedef u8_t netif_addr_idx_t;
|
|
||||||
#define NETIF_ADDR_IDX_MAX 0x7F
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_NETIF_HWADDRHINT
|
|
||||||
#define LWIP_NETIF_USE_HINTS 1
|
|
||||||
struct netif_hint {
|
|
||||||
netif_addr_idx_t addr_hint;
|
|
||||||
};
|
|
||||||
#else /* LWIP_NETIF_HWADDRHINT */
|
|
||||||
#define LWIP_NETIF_USE_HINTS 0
|
|
||||||
#endif /* LWIP_NETIF_HWADDRHINT */
|
|
||||||
|
|
||||||
/** Generic data structure used for all lwIP network interfaces.
|
|
||||||
* The following fields should be filled in by the initialization
|
|
||||||
* function for the device driver: hwaddr_len, hwaddr[], mtu, flags */
|
|
||||||
struct netif {
|
|
||||||
#if !LWIP_SINGLE_NETIF
|
|
||||||
/** pointer to next in linked list */
|
|
||||||
struct netif *next;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
/** IP address configuration in network byte order */
|
|
||||||
ip_addr_t ip_addr;
|
|
||||||
ip_addr_t netmask;
|
|
||||||
ip_addr_t gw;
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** Array of IPv6 addresses for this netif. */
|
|
||||||
ip_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES];
|
|
||||||
/** The state of each IPv6 address (Tentative, Preferred, etc).
|
|
||||||
* @see ip6_addr.h */
|
|
||||||
u8_t ip6_addr_state[LWIP_IPV6_NUM_ADDRESSES];
|
|
||||||
#if LWIP_IPV6_ADDRESS_LIFETIMES
|
|
||||||
/** Remaining valid and preferred lifetime of each IPv6 address, in seconds.
|
|
||||||
* For valid lifetimes, the special value of IP6_ADDR_LIFE_STATIC (0)
|
|
||||||
* indicates the address is static and has no lifetimes. */
|
|
||||||
u32_t ip6_addr_valid_life[LWIP_IPV6_NUM_ADDRESSES];
|
|
||||||
u32_t ip6_addr_pref_life[LWIP_IPV6_NUM_ADDRESSES];
|
|
||||||
#endif /* LWIP_IPV6_ADDRESS_LIFETIMES */
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
/** This function is called by the network device driver
|
|
||||||
* to pass a packet up the TCP/IP stack. */
|
|
||||||
netif_input_fn input;
|
|
||||||
#if LWIP_IPV4
|
|
||||||
/** This function is called by the IP module when it wants
|
|
||||||
* to send a packet on the interface. This function typically
|
|
||||||
* first resolves the hardware address, then sends the packet.
|
|
||||||
* For ethernet physical layer, this is usually etharp_output() */
|
|
||||||
netif_output_fn output;
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
/** This function is called by ethernet_output() when it wants
|
|
||||||
* to send a packet on the interface. This function outputs
|
|
||||||
* the pbuf as-is on the link medium. */
|
|
||||||
netif_linkoutput_fn linkoutput;
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** This function is called by the IPv6 module when it wants
|
|
||||||
* to send a packet on the interface. This function typically
|
|
||||||
* first resolves the hardware address, then sends the packet.
|
|
||||||
* For ethernet physical layer, this is usually ethip6_output() */
|
|
||||||
netif_output_ip6_fn output_ip6;
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
#if LWIP_NETIF_STATUS_CALLBACK
|
|
||||||
/** This function is called when the netif state is set to up or down
|
|
||||||
*/
|
|
||||||
netif_status_callback_fn status_callback;
|
|
||||||
#endif /* LWIP_NETIF_STATUS_CALLBACK */
|
|
||||||
#if LWIP_NETIF_LINK_CALLBACK
|
|
||||||
/** This function is called when the netif link is set to up or down
|
|
||||||
*/
|
|
||||||
netif_status_callback_fn link_callback;
|
|
||||||
#endif /* LWIP_NETIF_LINK_CALLBACK */
|
|
||||||
#if LWIP_NETIF_REMOVE_CALLBACK
|
|
||||||
/** This function is called when the netif has been removed */
|
|
||||||
netif_status_callback_fn remove_callback;
|
|
||||||
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
|
|
||||||
/** This field can be set by the device driver and could point
|
|
||||||
* to state information for the device. */
|
|
||||||
void *state;
|
|
||||||
#ifdef netif_get_client_data
|
|
||||||
void* client_data[LWIP_NETIF_CLIENT_DATA_INDEX_MAX + LWIP_NUM_NETIF_CLIENT_DATA];
|
|
||||||
#endif
|
|
||||||
#if LWIP_NETIF_HOSTNAME
|
|
||||||
/* the hostname for this netif, NULL is a valid value */
|
|
||||||
const char* hostname;
|
|
||||||
#endif /* LWIP_NETIF_HOSTNAME */
|
|
||||||
#if LWIP_CHECKSUM_CTRL_PER_NETIF
|
|
||||||
u16_t chksum_flags;
|
|
||||||
#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/
|
|
||||||
/** maximum transfer unit (in bytes) */
|
|
||||||
u16_t mtu;
|
|
||||||
#if LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES
|
|
||||||
/** maximum transfer unit (in bytes), updated by RA */
|
|
||||||
u16_t mtu6;
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES */
|
|
||||||
/** link level hardware address of this interface */
|
|
||||||
u8_t hwaddr[NETIF_MAX_HWADDR_LEN];
|
|
||||||
/** number of bytes used in hwaddr */
|
|
||||||
u8_t hwaddr_len;
|
|
||||||
/** flags (@see @ref netif_flags) */
|
|
||||||
u8_t flags;
|
|
||||||
#if LWIP_UDP_OPT_BLOCK_TX_TILL_COMPLETE
|
|
||||||
/** flags that are used to support the feature where for UDP Tx, the adapter send routine
|
|
||||||
* returns only when the respective packet is transmitted out */
|
|
||||||
u8_t block_tx_till_complt;
|
|
||||||
#endif
|
|
||||||
/** descriptive abbreviation */
|
|
||||||
char name[2];
|
|
||||||
/** number of this interface. Used for @ref if_api and @ref netifapi_netif,
|
|
||||||
* as well as for IPv6 zones */
|
|
||||||
u8_t num;
|
|
||||||
#if LWIP_IPV6_AUTOCONFIG
|
|
||||||
/** is this netif enabled for IPv6 autoconfiguration */
|
|
||||||
u8_t ip6_autoconfig_enabled;
|
|
||||||
#endif /* LWIP_IPV6_AUTOCONFIG */
|
|
||||||
#if LWIP_IPV6_SEND_ROUTER_SOLICIT
|
|
||||||
/** Number of Router Solicitation messages that remain to be sent. */
|
|
||||||
u8_t rs_count;
|
|
||||||
#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */
|
|
||||||
#if MIB2_STATS
|
|
||||||
/** link type (from "snmp_ifType" enum from snmp_mib2.h) */
|
|
||||||
u8_t link_type;
|
|
||||||
/** (estimate) link speed */
|
|
||||||
u32_t link_speed;
|
|
||||||
/** timestamp at last change made (up/down) */
|
|
||||||
u32_t ts;
|
|
||||||
/** counters */
|
|
||||||
struct stats_mib2_netif_ctrs mib2_counters;
|
|
||||||
#endif /* MIB2_STATS */
|
|
||||||
#if LWIP_IPV4 && LWIP_IGMP
|
|
||||||
/** This function could be called to add or delete an entry in the multicast
|
|
||||||
filter table of the ethernet MAC.*/
|
|
||||||
netif_igmp_mac_filter_fn igmp_mac_filter;
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IGMP */
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
|
||||||
/** This function could be called to add or delete an entry in the IPv6 multicast
|
|
||||||
filter table of the ethernet MAC. */
|
|
||||||
netif_mld_mac_filter_fn mld_mac_filter;
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
|
||||||
#if LWIP_NETIF_USE_HINTS
|
|
||||||
struct netif_hint *hints;
|
|
||||||
#endif /* LWIP_NETIF_USE_HINTS */
|
|
||||||
#if ENABLE_LOOPBACK
|
|
||||||
/* List of packets to be queued for ourselves. */
|
|
||||||
struct pbuf *loop_first;
|
|
||||||
struct pbuf *loop_last;
|
|
||||||
#if LWIP_LOOPBACK_MAX_PBUFS
|
|
||||||
u16_t loop_cnt_current;
|
|
||||||
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
|
|
||||||
#if LWIP_NETIF_LOOPBACK_MULTITHREADING
|
|
||||||
/* Used if the original scheduling failed. */
|
|
||||||
u8_t reschedule_poll;
|
|
||||||
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
|
||||||
#endif /* ENABLE_LOOPBACK */
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_CHECKSUM_CTRL_PER_NETIF
|
|
||||||
#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \
|
|
||||||
(netif)->chksum_flags = chksumflags; } while(0)
|
|
||||||
#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0))
|
|
||||||
#else /* LWIP_CHECKSUM_CTRL_PER_NETIF */
|
|
||||||
#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)
|
|
||||||
#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)
|
|
||||||
#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */
|
|
||||||
|
|
||||||
#if LWIP_SINGLE_NETIF
|
|
||||||
#define NETIF_FOREACH(netif) if (((netif) = netif_default) != NULL)
|
|
||||||
#else /* LWIP_SINGLE_NETIF */
|
|
||||||
/** The list of network interfaces. */
|
|
||||||
extern struct netif *netif_list;
|
|
||||||
#define NETIF_FOREACH(netif) for ((netif) = netif_list; (netif) != NULL; (netif) = (netif)->next)
|
|
||||||
#endif /* LWIP_SINGLE_NETIF */
|
|
||||||
/** The default network interface. */
|
|
||||||
extern struct netif *netif_default;
|
|
||||||
|
|
||||||
void netif_init(void);
|
|
||||||
|
|
||||||
struct netif *netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
struct netif *netif_add(struct netif *netif,
|
|
||||||
const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
|
|
||||||
void *state, netif_init_fn init, netif_input_fn input);
|
|
||||||
void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask,
|
|
||||||
const ip4_addr_t *gw);
|
|
||||||
#else /* LWIP_IPV4 */
|
|
||||||
struct netif *netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
void netif_remove(struct netif * netif);
|
|
||||||
|
|
||||||
/* Returns a network interface given its name. The name is of the form
|
|
||||||
"et0", where the first two letters are the "name" field in the
|
|
||||||
netif structure, and the digit is in the num field in the same
|
|
||||||
structure. */
|
|
||||||
struct netif *netif_find(const char *name);
|
|
||||||
|
|
||||||
void netif_set_default(struct netif *netif);
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr);
|
|
||||||
void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask);
|
|
||||||
void netif_set_gw(struct netif *netif, const ip4_addr_t *gw);
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr)))
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask)))
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw)))
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr))
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask))
|
|
||||||
/** @ingroup netif_ip4 */
|
|
||||||
#define netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw))
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
|
|
||||||
#define netif_set_flags(netif, set_flags) do { (netif)->flags = (u8_t)((netif)->flags | (set_flags)); } while(0)
|
|
||||||
#define netif_clear_flags(netif, clr_flags) do { (netif)->flags = (u8_t)((netif)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
|
|
||||||
#define netif_is_flag_set(nefif, flag) (((netif)->flags & (flag)) != 0)
|
|
||||||
#if LWIP_UDP_OPT_BLOCK_TX_TILL_COMPLETE
|
|
||||||
#define netif_set_opt_block_tx(netif, set_flags) do { (netif)->block_tx_till_complt = (u8_t)((netif)->block_tx_till_complt | (set_flags)); } while(0)
|
|
||||||
#define netif_clear_opt_block_tx(netif, clr_flags) do { (netif)->block_tx_till_complt = (u8_t)((netif)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
|
|
||||||
#define netif_is_opt_block_tx_set(nefif, flag) (((netif)->block_tx_till_complt & (flag)) != 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void netif_set_up(struct netif *netif);
|
|
||||||
void netif_set_down(struct netif *netif);
|
|
||||||
/** @ingroup netif
|
|
||||||
* Ask if an interface is up
|
|
||||||
*/
|
|
||||||
#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
|
|
||||||
|
|
||||||
#if LWIP_NETIF_STATUS_CALLBACK
|
|
||||||
void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
|
|
||||||
#endif /* LWIP_NETIF_STATUS_CALLBACK */
|
|
||||||
#if LWIP_NETIF_REMOVE_CALLBACK
|
|
||||||
void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback);
|
|
||||||
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
|
|
||||||
|
|
||||||
void netif_set_link_up(struct netif *netif);
|
|
||||||
void netif_set_link_down(struct netif *netif);
|
|
||||||
/** Ask if a link is up */
|
|
||||||
#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
|
|
||||||
|
|
||||||
#if LWIP_NETIF_LINK_CALLBACK
|
|
||||||
void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback);
|
|
||||||
#endif /* LWIP_NETIF_LINK_CALLBACK */
|
|
||||||
|
|
||||||
#if LWIP_NETIF_HOSTNAME
|
|
||||||
/** @ingroup netif */
|
|
||||||
#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
|
|
||||||
/** @ingroup netif */
|
|
||||||
#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
|
|
||||||
#endif /* LWIP_NETIF_HOSTNAME */
|
|
||||||
|
|
||||||
#if LWIP_IGMP
|
|
||||||
/** @ingroup netif */
|
|
||||||
#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
|
|
||||||
#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)
|
|
||||||
#endif /* LWIP_IGMP */
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
|
||||||
/** @ingroup netif */
|
|
||||||
#define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0)
|
|
||||||
#define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL)
|
|
||||||
#define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0)
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
|
||||||
|
|
||||||
#if ENABLE_LOOPBACK
|
|
||||||
err_t netif_loop_output(struct netif *netif, struct pbuf *p);
|
|
||||||
void netif_poll(struct netif *netif);
|
|
||||||
#if !LWIP_NETIF_LOOPBACK_MULTITHREADING
|
|
||||||
void netif_poll_all(void);
|
|
||||||
#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
|
||||||
#endif /* ENABLE_LOOPBACK */
|
|
||||||
|
|
||||||
err_t netif_input(struct pbuf *p, struct netif *inp);
|
|
||||||
|
|
||||||
#if LWIP_IPV6
|
|
||||||
/** @ingroup netif_ip6 */
|
|
||||||
#define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i])))
|
|
||||||
/** @ingroup netif_ip6 */
|
|
||||||
#define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i])))
|
|
||||||
void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6);
|
|
||||||
void netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3);
|
|
||||||
#define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i])
|
|
||||||
void netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state);
|
|
||||||
s8_t netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr);
|
|
||||||
void netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit);
|
|
||||||
err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx);
|
|
||||||
#define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0)
|
|
||||||
#if LWIP_IPV6_ADDRESS_LIFETIMES
|
|
||||||
#define netif_ip6_addr_valid_life(netif, i) \
|
|
||||||
(((netif) != NULL) ? ((netif)->ip6_addr_valid_life[i]) : IP6_ADDR_LIFE_STATIC)
|
|
||||||
#define netif_ip6_addr_set_valid_life(netif, i, secs) \
|
|
||||||
do { if (netif != NULL) { (netif)->ip6_addr_valid_life[i] = (secs); }} while (0)
|
|
||||||
#define netif_ip6_addr_pref_life(netif, i) \
|
|
||||||
(((netif) != NULL) ? ((netif)->ip6_addr_pref_life[i]) : IP6_ADDR_LIFE_STATIC)
|
|
||||||
#define netif_ip6_addr_set_pref_life(netif, i, secs) \
|
|
||||||
do { if (netif != NULL) { (netif)->ip6_addr_pref_life[i] = (secs); }} while (0)
|
|
||||||
#define netif_ip6_addr_isstatic(netif, i) \
|
|
||||||
(netif_ip6_addr_valid_life((netif), (i)) == IP6_ADDR_LIFE_STATIC)
|
|
||||||
#else /* !LWIP_IPV6_ADDRESS_LIFETIMES */
|
|
||||||
#define netif_ip6_addr_isstatic(netif, i) (1) /* all addresses are static */
|
|
||||||
#endif /* !LWIP_IPV6_ADDRESS_LIFETIMES */
|
|
||||||
#if LWIP_ND6_ALLOW_RA_UPDATES
|
|
||||||
#define netif_mtu6(netif) ((netif)->mtu6)
|
|
||||||
#else /* LWIP_ND6_ALLOW_RA_UPDATES */
|
|
||||||
#define netif_mtu6(netif) ((netif)->mtu)
|
|
||||||
#endif /* LWIP_ND6_ALLOW_RA_UPDATES */
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#if LWIP_NETIF_USE_HINTS
|
|
||||||
#define NETIF_SET_HINTS(netif, netifhint) (netif)->hints = (netifhint)
|
|
||||||
#define NETIF_RESET_HINTS(netif) (netif)->hints = NULL
|
|
||||||
#else /* LWIP_NETIF_USE_HINTS */
|
|
||||||
#define NETIF_SET_HINTS(netif, netifhint)
|
|
||||||
#define NETIF_RESET_HINTS(netif)
|
|
||||||
#endif /* LWIP_NETIF_USE_HINTS */
|
|
||||||
|
|
||||||
u8_t netif_name_to_index(const char *name);
|
|
||||||
char * netif_index_to_name(u8_t idx, char *name);
|
|
||||||
struct netif* netif_get_by_index(u8_t idx);
|
|
||||||
|
|
||||||
/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 (internal index is 0..254)*/
|
|
||||||
#define netif_get_index(netif) ((u8_t)((netif)->num + 1))
|
|
||||||
#define NETIF_NO_INDEX (0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup netif
|
|
||||||
* Extended netif status callback (NSC) reasons flags.
|
|
||||||
* May be extended in the future!
|
|
||||||
*/
|
|
||||||
typedef u16_t netif_nsc_reason_t;
|
|
||||||
|
|
||||||
/* used for initialization only */
|
|
||||||
#define LWIP_NSC_NONE 0x0000
|
|
||||||
/** netif was added. arg: NULL. Called AFTER netif was added. */
|
|
||||||
#define LWIP_NSC_NETIF_ADDED 0x0001
|
|
||||||
/** netif was removed. arg: NULL. Called BEFORE netif is removed. */
|
|
||||||
#define LWIP_NSC_NETIF_REMOVED 0x0002
|
|
||||||
/** link changed */
|
|
||||||
#define LWIP_NSC_LINK_CHANGED 0x0004
|
|
||||||
/** netif administrative status changed.\n
|
|
||||||
* up is called AFTER netif is set up.\n
|
|
||||||
* down is called BEFORE the netif is actually set down. */
|
|
||||||
#define LWIP_NSC_STATUS_CHANGED 0x0008
|
|
||||||
/** IPv4 address has changed */
|
|
||||||
#define LWIP_NSC_IPV4_ADDRESS_CHANGED 0x0010
|
|
||||||
/** IPv4 gateway has changed */
|
|
||||||
#define LWIP_NSC_IPV4_GATEWAY_CHANGED 0x0020
|
|
||||||
/** IPv4 netmask has changed */
|
|
||||||
#define LWIP_NSC_IPV4_NETMASK_CHANGED 0x0040
|
|
||||||
/** called AFTER IPv4 address/gateway/netmask changes have been applied */
|
|
||||||
#define LWIP_NSC_IPV4_SETTINGS_CHANGED 0x0080
|
|
||||||
/** IPv6 address was added */
|
|
||||||
#define LWIP_NSC_IPV6_SET 0x0100
|
|
||||||
/** IPv6 address state has changed */
|
|
||||||
#define LWIP_NSC_IPV6_ADDR_STATE_CHANGED 0x0200
|
|
||||||
|
|
||||||
/** @ingroup netif
|
|
||||||
* Argument supplied to netif_ext_callback_fn.
|
|
||||||
*/
|
|
||||||
typedef union
|
|
||||||
{
|
|
||||||
/** Args to LWIP_NSC_LINK_CHANGED callback */
|
|
||||||
struct link_changed_s
|
|
||||||
{
|
|
||||||
/** 1: up; 0: down */
|
|
||||||
u8_t state;
|
|
||||||
} link_changed;
|
|
||||||
/** Args to LWIP_NSC_STATUS_CHANGED callback */
|
|
||||||
struct status_changed_s
|
|
||||||
{
|
|
||||||
/** 1: up; 0: down */
|
|
||||||
u8_t state;
|
|
||||||
} status_changed;
|
|
||||||
/** Args to LWIP_NSC_IPV4_ADDRESS_CHANGED|LWIP_NSC_IPV4_GATEWAY_CHANGED|LWIP_NSC_IPV4_NETMASK_CHANGED|LWIP_NSC_IPV4_SETTINGS_CHANGED callback */
|
|
||||||
struct ipv4_changed_s
|
|
||||||
{
|
|
||||||
/** Old IPv4 address */
|
|
||||||
const ip_addr_t* old_address;
|
|
||||||
const ip_addr_t* old_netmask;
|
|
||||||
const ip_addr_t* old_gw;
|
|
||||||
} ipv4_changed;
|
|
||||||
/** Args to LWIP_NSC_IPV6_SET callback */
|
|
||||||
struct ipv6_set_s
|
|
||||||
{
|
|
||||||
/** Index of changed IPv6 address */
|
|
||||||
s8_t addr_index;
|
|
||||||
/** Old IPv6 address */
|
|
||||||
const ip_addr_t* old_address;
|
|
||||||
} ipv6_set;
|
|
||||||
/** Args to LWIP_NSC_IPV6_ADDR_STATE_CHANGED callback */
|
|
||||||
struct ipv6_addr_state_changed_s
|
|
||||||
{
|
|
||||||
/** Index of affected IPv6 address */
|
|
||||||
s8_t addr_index;
|
|
||||||
/** Old IPv6 address state */
|
|
||||||
u8_t old_state;
|
|
||||||
/** Affected IPv6 address */
|
|
||||||
const ip_addr_t* address;
|
|
||||||
} ipv6_addr_state_changed;
|
|
||||||
} netif_ext_callback_args_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup netif
|
|
||||||
* Function used for extended netif status callbacks
|
|
||||||
* Note: When parsing reason argument, keep in mind that more reasons may be added in the future!
|
|
||||||
* @param netif netif that is affected by change
|
|
||||||
* @param reason change reason
|
|
||||||
* @param args depends on reason, see reason description
|
|
||||||
*/
|
|
||||||
typedef void (*netif_ext_callback_fn)(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args);
|
|
||||||
|
|
||||||
#if LWIP_NETIF_EXT_STATUS_CALLBACK
|
|
||||||
struct netif_ext_callback;
|
|
||||||
typedef struct netif_ext_callback
|
|
||||||
{
|
|
||||||
netif_ext_callback_fn callback_fn;
|
|
||||||
struct netif_ext_callback* next;
|
|
||||||
} netif_ext_callback_t;
|
|
||||||
|
|
||||||
#define NETIF_DECLARE_EXT_CALLBACK(name) static netif_ext_callback_t name;
|
|
||||||
void netif_add_ext_callback(netif_ext_callback_t* callback, netif_ext_callback_fn fn);
|
|
||||||
void netif_remove_ext_callback(netif_ext_callback_t* callback);
|
|
||||||
void netif_invoke_ext_callback(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args);
|
|
||||||
#else
|
|
||||||
#define NETIF_DECLARE_EXT_CALLBACK(name)
|
|
||||||
#define netif_add_ext_callback(callback, fn)
|
|
||||||
#define netif_remove_ext_callback(callback)
|
|
||||||
#define netif_invoke_ext_callback(netif, reason, args)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETIF_H */
|
|
||||||
-161
@@ -1,161 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* netif API (to be used from non-TCPIP threads)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_NETIFAPI_H
|
|
||||||
#define LWIP_HDR_NETIFAPI_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/sys.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/dhcp.h"
|
|
||||||
#include "lwip/autoip.h"
|
|
||||||
#include "lwip/priv/tcpip_priv.h"
|
|
||||||
#include "lwip/priv/api_msg.h"
|
|
||||||
#include "lwip/prot/ethernet.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* API for application */
|
|
||||||
#if LWIP_ARP && LWIP_IPV4
|
|
||||||
/* Used for netfiapi_arp_* APIs */
|
|
||||||
enum netifapi_arp_entry {
|
|
||||||
NETIFAPI_ARP_PERM /* Permanent entry */
|
|
||||||
/* Other entry types can be added here */
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @ingroup netifapi_arp */
|
|
||||||
err_t netifapi_arp_add(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, enum netifapi_arp_entry type);
|
|
||||||
/** @ingroup netifapi_arp */
|
|
||||||
err_t netifapi_arp_remove(const ip4_addr_t *ipaddr, enum netifapi_arp_entry type);
|
|
||||||
#endif /* LWIP_ARP && LWIP_IPV4 */
|
|
||||||
|
|
||||||
err_t netifapi_netif_add(struct netif *netif,
|
|
||||||
#if LWIP_IPV4
|
|
||||||
const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
void *state, netif_init_fn init, netif_input_fn input);
|
|
||||||
|
|
||||||
#if LWIP_IPV4
|
|
||||||
err_t netifapi_netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr,
|
|
||||||
const ip4_addr_t *netmask, const ip4_addr_t *gw);
|
|
||||||
#endif /* LWIP_IPV4*/
|
|
||||||
|
|
||||||
err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
|
|
||||||
netifapi_errt_fn errtfunc);
|
|
||||||
|
|
||||||
/** @ingroup netifapi_netif */
|
|
||||||
err_t netifapi_netif_name_to_index(const char *name, u8_t *index);
|
|
||||||
/** @ingroup netifapi_netif */
|
|
||||||
err_t netifapi_netif_index_to_name(u8_t index, char *name);
|
|
||||||
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_remove()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_set_up()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_set_down()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_set_default()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_set_link_up()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_set_link_up(n) netifapi_netif_common(n, netif_set_link_up, NULL)
|
|
||||||
/** @ingroup netifapi_netif
|
|
||||||
* @see netif_set_link_down()
|
|
||||||
*/
|
|
||||||
#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup netifapi_dhcp4 DHCPv4
|
|
||||||
* @ingroup netifapi
|
|
||||||
* To be called from non-TCPIP threads
|
|
||||||
*/
|
|
||||||
/** @ingroup netifapi_dhcp4
|
|
||||||
* @see dhcp_start()
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
|
|
||||||
/**
|
|
||||||
* @ingroup netifapi_dhcp4
|
|
||||||
* @deprecated Use netifapi_dhcp_release_and_stop() instead.
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
|
|
||||||
/** @ingroup netifapi_dhcp4
|
|
||||||
* @see dhcp_inform()
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_inform(n) netifapi_netif_common(n, dhcp_inform, NULL)
|
|
||||||
/** @ingroup netifapi_dhcp4
|
|
||||||
* @see dhcp_renew()
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_renew(n) netifapi_netif_common(n, NULL, dhcp_renew)
|
|
||||||
/**
|
|
||||||
* @ingroup netifapi_dhcp4
|
|
||||||
* @deprecated Use netifapi_dhcp_release_and_stop() instead.
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_release(n) netifapi_netif_common(n, NULL, dhcp_release)
|
|
||||||
/** @ingroup netifapi_dhcp4
|
|
||||||
* @see dhcp_release_and_stop()
|
|
||||||
*/
|
|
||||||
#define netifapi_dhcp_release_and_stop(n) netifapi_netif_common(n, dhcp_release_and_stop, NULL)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup netifapi_autoip AUTOIP
|
|
||||||
* @ingroup netifapi
|
|
||||||
* To be called from non-TCPIP threads
|
|
||||||
*/
|
|
||||||
/** @ingroup netifapi_autoip
|
|
||||||
* @see autoip_start()
|
|
||||||
*/
|
|
||||||
#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
|
|
||||||
/** @ingroup netifapi_autoip
|
|
||||||
* @see autoip_stop()
|
|
||||||
*/
|
|
||||||
#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_NETIF_API */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETIFAPI_H */
|
|
||||||
-3530
File diff suppressed because it is too large
Load Diff
-326
@@ -1,326 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* pbuf API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_PBUF_H
|
|
||||||
#define LWIP_HDR_PBUF_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type
|
|
||||||
* but they are allocated by external code (initialised by calling
|
|
||||||
* pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they
|
|
||||||
* are freed by calling pbuf_custom->custom_free_function().
|
|
||||||
* Currently, the pbuf_custom code is only needed for one specific configuration
|
|
||||||
* of IP_FRAG, unless required by external driver/application code. */
|
|
||||||
#ifndef LWIP_SUPPORT_CUSTOM_PBUF
|
|
||||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @ingroup pbuf
|
|
||||||
* PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given
|
|
||||||
* pbuf needs to be copied in order to be kept around beyond the current call
|
|
||||||
* stack without risking being corrupted. The default setting provides safety:
|
|
||||||
* it will make a copy iof any pbuf chain that does not consist entirely of
|
|
||||||
* PBUF_ROM type pbufs. For setups with zero-copy support, it may be redefined
|
|
||||||
* to evaluate to true in all cases, for example. However, doing so also has an
|
|
||||||
* effect on the application side: any buffers that are *not* copied must also
|
|
||||||
* *not* be reused by the application after passing them to lwIP. For example,
|
|
||||||
* when setting PBUF_NEEDS_COPY to (0), after using udp_send() with a PBUF_RAM
|
|
||||||
* pbuf, the application must free the pbuf immediately, rather than reusing it
|
|
||||||
* for other purposes. For more background information on this, see tasks #6735
|
|
||||||
* and #7896, and bugs #11400 and #49914. */
|
|
||||||
#ifndef PBUF_NEEDS_COPY
|
|
||||||
#define PBUF_NEEDS_COPY(p) ((p)->type_internal & PBUF_TYPE_FLAG_DATA_VOLATILE)
|
|
||||||
#endif /* PBUF_NEEDS_COPY */
|
|
||||||
|
|
||||||
/* @todo: We need a mechanism to prevent wasting memory in every pbuf
|
|
||||||
(TCP vs. UDP, IPv4 vs. IPv6: UDP/IPv4 packets may waste up to 28 bytes) */
|
|
||||||
|
|
||||||
#define PBUF_TRANSPORT_HLEN 20
|
|
||||||
#if LWIP_IPV6
|
|
||||||
#define PBUF_IP_HLEN 40
|
|
||||||
#else
|
|
||||||
#define PBUF_IP_HLEN 20
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup pbuf
|
|
||||||
* Enumeration of pbuf layers
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
/** Includes spare room for transport layer header, e.g. UDP header.
|
|
||||||
* Use this if you intend to pass the pbuf to functions like udp_send().
|
|
||||||
*/
|
|
||||||
PBUF_TRANSPORT = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN,
|
|
||||||
/** Includes spare room for IP header.
|
|
||||||
* Use this if you intend to pass the pbuf to functions like raw_send().
|
|
||||||
*/
|
|
||||||
PBUF_IP = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN,
|
|
||||||
/** Includes spare room for link layer header (ethernet header).
|
|
||||||
* Use this if you intend to pass the pbuf to functions like ethernet_output().
|
|
||||||
* @see PBUF_LINK_HLEN
|
|
||||||
*/
|
|
||||||
PBUF_LINK = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN,
|
|
||||||
/** Includes spare room for additional encapsulation header before ethernet
|
|
||||||
* headers (e.g. 802.11).
|
|
||||||
* Use this if you intend to pass the pbuf to functions like netif->linkoutput().
|
|
||||||
* @see PBUF_LINK_ENCAPSULATION_HLEN
|
|
||||||
*/
|
|
||||||
PBUF_RAW_TX = PBUF_LINK_ENCAPSULATION_HLEN,
|
|
||||||
/** Use this for input packets in a netif driver when calling netif->input()
|
|
||||||
* in the most common case - ethernet-layer netif driver. */
|
|
||||||
PBUF_RAW = 0
|
|
||||||
} pbuf_layer;
|
|
||||||
|
|
||||||
|
|
||||||
/* Base flags for pbuf_type definitions: */
|
|
||||||
|
|
||||||
/** Indicates that the payload directly follows the struct pbuf.
|
|
||||||
* This makes @ref pbuf_header work in both directions. */
|
|
||||||
#define PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS 0x80
|
|
||||||
/** Indicates the data stored in this pbuf can change. If this pbuf needs
|
|
||||||
* to be queued, it must be copied/duplicated. */
|
|
||||||
#define PBUF_TYPE_FLAG_DATA_VOLATILE 0x40
|
|
||||||
/** 4 bits are reserved for 16 allocation sources (e.g. heap, pool1, pool2, etc)
|
|
||||||
* Internally, we use: 0=heap, 1=MEMP_PBUF, 2=MEMP_PBUF_POOL -> 13 types free*/
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK 0x0F
|
|
||||||
/** Indicates this pbuf is used for RX (if not set, indicates use for TX).
|
|
||||||
* This information can be used to keep some spare RX buffers e.g. for
|
|
||||||
* receiving TCP ACKs to unblock a connection) */
|
|
||||||
#define PBUF_ALLOC_FLAG_RX 0x0100
|
|
||||||
/** Indicates the application needs the pbuf payload to be in one piece */
|
|
||||||
#define PBUF_ALLOC_FLAG_DATA_CONTIGUOUS 0x0200
|
|
||||||
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP 0x00
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF 0x01
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL 0x02
|
|
||||||
/** First pbuf allocation type for applications */
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MIN 0x03
|
|
||||||
/** Last pbuf allocation type for applications */
|
|
||||||
#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MAX PBUF_TYPE_ALLOC_SRC_MASK
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup pbuf
|
|
||||||
* Enumeration of pbuf types
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
/** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload
|
|
||||||
are allocated in one piece of contiguous memory (so the first payload byte
|
|
||||||
can be calculated from struct pbuf).
|
|
||||||
pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might
|
|
||||||
change in future versions).
|
|
||||||
This should be used for all OUTGOING packets (TX).*/
|
|
||||||
PBUF_RAM = (PBUF_ALLOC_FLAG_DATA_CONTIGUOUS | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP),
|
|
||||||
/** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in
|
|
||||||
totally different memory areas. Since it points to ROM, payload does not
|
|
||||||
have to be copied when queued for transmission. */
|
|
||||||
PBUF_ROM = PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF,
|
|
||||||
/** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change
|
|
||||||
so it has to be duplicated when queued before transmitting, depending on
|
|
||||||
who has a 'ref' to it. */
|
|
||||||
PBUF_REF = (PBUF_TYPE_FLAG_DATA_VOLATILE | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF),
|
|
||||||
/** pbuf payload refers to RAM. This one comes from a pool and should be used
|
|
||||||
for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct
|
|
||||||
pbuf and its payload are allocated in one piece of contiguous memory (so
|
|
||||||
the first payload byte can be calculated from struct pbuf).
|
|
||||||
Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing,
|
|
||||||
you are unable to receive TCP acks! */
|
|
||||||
PBUF_POOL = (PBUF_ALLOC_FLAG_RX | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL)
|
|
||||||
} pbuf_type;
|
|
||||||
|
|
||||||
|
|
||||||
/** indicates this packet's data should be immediately passed to the application */
|
|
||||||
#define PBUF_FLAG_PUSH 0x01U
|
|
||||||
/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function()
|
|
||||||
when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */
|
|
||||||
#define PBUF_FLAG_IS_CUSTOM 0x02U
|
|
||||||
/** indicates this pbuf is UDP multicast to be looped back */
|
|
||||||
#define PBUF_FLAG_MCASTLOOP 0x04U
|
|
||||||
/** indicates this pbuf was received as link-level broadcast */
|
|
||||||
#define PBUF_FLAG_LLBCAST 0x08U
|
|
||||||
/** indicates this pbuf was received as link-level multicast */
|
|
||||||
#define PBUF_FLAG_LLMCAST 0x10U
|
|
||||||
/** indicates this pbuf includes a TCP FIN flag */
|
|
||||||
#define PBUF_FLAG_TCP_FIN 0x20U
|
|
||||||
|
|
||||||
/** Main packet buffer struct */
|
|
||||||
struct pbuf {
|
|
||||||
/** next pbuf in singly linked pbuf chain */
|
|
||||||
struct pbuf *next;
|
|
||||||
|
|
||||||
/** pointer to the actual data in the buffer */
|
|
||||||
void *payload;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* total length of this buffer and all next buffers in chain
|
|
||||||
* belonging to the same packet.
|
|
||||||
*
|
|
||||||
* For non-queue packet chains this is the invariant:
|
|
||||||
* p->tot_len == p->len + (p->next? p->next->tot_len: 0)
|
|
||||||
*/
|
|
||||||
u16_t tot_len;
|
|
||||||
|
|
||||||
/** length of this buffer */
|
|
||||||
u16_t len;
|
|
||||||
|
|
||||||
/** a bit field indicating pbuf type and allocation sources
|
|
||||||
(see PBUF_TYPE_FLAG_*, PBUF_ALLOC_FLAG_* and PBUF_TYPE_ALLOC_SRC_MASK)
|
|
||||||
*/
|
|
||||||
u8_t type_internal;
|
|
||||||
|
|
||||||
/** misc flags */
|
|
||||||
u8_t flags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* the reference count always equals the number of pointers
|
|
||||||
* that refer to this pbuf. This can be pointers from an application,
|
|
||||||
* the stack itself, or pbuf->next pointers from a chain.
|
|
||||||
*/
|
|
||||||
LWIP_PBUF_REF_T ref;
|
|
||||||
|
|
||||||
/** For incoming packets, this contains the input netif's index */
|
|
||||||
u8_t if_idx;
|
|
||||||
|
|
||||||
/** In case the user needs to store data custom data on a pbuf */
|
|
||||||
LWIP_PBUF_CUSTOM_DATA
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/** Helper struct for const-correctness only.
|
|
||||||
* The only meaning of this one is to provide a const payload pointer
|
|
||||||
* for PBUF_ROM type.
|
|
||||||
*/
|
|
||||||
struct pbuf_rom {
|
|
||||||
/** next pbuf in singly linked pbuf chain */
|
|
||||||
struct pbuf *next;
|
|
||||||
|
|
||||||
/** pointer to the actual data in the buffer */
|
|
||||||
const void *payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_SUPPORT_CUSTOM_PBUF
|
|
||||||
/** Prototype for a function to free a custom pbuf */
|
|
||||||
typedef void (*pbuf_free_custom_fn)(struct pbuf *p);
|
|
||||||
|
|
||||||
/** A custom pbuf: like a pbuf, but following a function pointer to free it. */
|
|
||||||
struct pbuf_custom {
|
|
||||||
/** The actual pbuf */
|
|
||||||
struct pbuf pbuf;
|
|
||||||
/** This function is called when pbuf_free deallocates this pbuf(_custom) */
|
|
||||||
pbuf_free_custom_fn custom_free_function;
|
|
||||||
};
|
|
||||||
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
|
|
||||||
|
|
||||||
/** Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty */
|
|
||||||
#ifndef PBUF_POOL_FREE_OOSEQ
|
|
||||||
#define PBUF_POOL_FREE_OOSEQ 1
|
|
||||||
#endif /* PBUF_POOL_FREE_OOSEQ */
|
|
||||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ
|
|
||||||
extern volatile u8_t pbuf_free_ooseq_pending;
|
|
||||||
void pbuf_free_ooseq(void);
|
|
||||||
/** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ()
|
|
||||||
at regular intervals from main level to check if ooseq pbufs need to be
|
|
||||||
freed! */
|
|
||||||
#define PBUF_CHECK_FREE_OOSEQ() do { if(pbuf_free_ooseq_pending) { \
|
|
||||||
/* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \
|
|
||||||
ooseq queued pbufs now */ \
|
|
||||||
pbuf_free_ooseq(); }}while(0)
|
|
||||||
#else /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ */
|
|
||||||
/* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */
|
|
||||||
#define PBUF_CHECK_FREE_OOSEQ()
|
|
||||||
#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ*/
|
|
||||||
|
|
||||||
/* Initializes the pbuf module. This call is empty for now, but may not be in future. */
|
|
||||||
#define pbuf_init()
|
|
||||||
|
|
||||||
struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type);
|
|
||||||
struct pbuf *pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type);
|
|
||||||
#if LWIP_SUPPORT_CUSTOM_PBUF
|
|
||||||
struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type,
|
|
||||||
struct pbuf_custom *p, void *payload_mem,
|
|
||||||
u16_t payload_mem_len);
|
|
||||||
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
|
|
||||||
void pbuf_realloc(struct pbuf *p, u16_t size);
|
|
||||||
#define pbuf_get_allocsrc(p) ((p)->type_internal & PBUF_TYPE_ALLOC_SRC_MASK)
|
|
||||||
#define pbuf_match_allocsrc(p, type) (pbuf_get_allocsrc(p) == ((type) & PBUF_TYPE_ALLOC_SRC_MASK))
|
|
||||||
#define pbuf_match_type(p, type) pbuf_match_allocsrc(p, type)
|
|
||||||
u8_t pbuf_header(struct pbuf *p, s16_t header_size);
|
|
||||||
u8_t pbuf_header_force(struct pbuf *p, s16_t header_size);
|
|
||||||
u8_t pbuf_add_header(struct pbuf *p, size_t header_size_increment);
|
|
||||||
u8_t pbuf_add_header_force(struct pbuf *p, size_t header_size_increment);
|
|
||||||
u8_t pbuf_remove_header(struct pbuf *p, size_t header_size);
|
|
||||||
struct pbuf *pbuf_free_header(struct pbuf *q, u16_t size);
|
|
||||||
void pbuf_ref(struct pbuf *p);
|
|
||||||
u8_t pbuf_free(struct pbuf *p);
|
|
||||||
u16_t pbuf_clen(const struct pbuf *p);
|
|
||||||
void pbuf_cat(struct pbuf *head, struct pbuf *tail);
|
|
||||||
void pbuf_chain(struct pbuf *head, struct pbuf *tail);
|
|
||||||
struct pbuf *pbuf_dechain(struct pbuf *p);
|
|
||||||
err_t pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from);
|
|
||||||
err_t pbuf_copy_partial_pbuf(struct pbuf *p_to, const struct pbuf *p_from, u16_t copy_len, u16_t offset);
|
|
||||||
u16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, u16_t len, u16_t offset);
|
|
||||||
void *pbuf_get_contiguous(const struct pbuf *p, void *buffer, size_t bufsize, u16_t len, u16_t offset);
|
|
||||||
err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len);
|
|
||||||
err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset);
|
|
||||||
struct pbuf *pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset);
|
|
||||||
struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer);
|
|
||||||
struct pbuf *pbuf_clone(pbuf_layer l, pbuf_type type, struct pbuf *p);
|
|
||||||
#if LWIP_CHECKSUM_ON_COPY
|
|
||||||
err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
|
|
||||||
u16_t len, u16_t *chksum);
|
|
||||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
|
||||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
|
|
||||||
void pbuf_split_64k(struct pbuf *p, struct pbuf **rest);
|
|
||||||
#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
|
|
||||||
|
|
||||||
u8_t pbuf_get_at(const struct pbuf* p, u16_t offset);
|
|
||||||
int pbuf_try_get_at(const struct pbuf* p, u16_t offset);
|
|
||||||
void pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data);
|
|
||||||
u16_t pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n);
|
|
||||||
u16_t pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset);
|
|
||||||
u16_t pbuf_strstr(const struct pbuf* p, const char* substr);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_PBUF_H */
|
|
||||||
-159
@@ -1,159 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* Application layered TCP connection API (to be used from TCPIP thread)\n
|
|
||||||
* This interface mimics the tcp callback API to the application while preventing
|
|
||||||
* direct linking (much like virtual functions).
|
|
||||||
* This way, an application can make use of other application layer protocols
|
|
||||||
* on top of TCP without knowing the details (e.g. TLS, proxy connection).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Simon Goldschmidt
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_ALTCP_PRIV_H
|
|
||||||
#define LWIP_HDR_ALTCP_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/altcp.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct altcp_pcb *altcp_alloc(void);
|
|
||||||
void altcp_free(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
/* Function prototypes for application layers */
|
|
||||||
typedef void (*altcp_set_poll_fn)(struct altcp_pcb *conn, u8_t interval);
|
|
||||||
typedef void (*altcp_recved_fn)(struct altcp_pcb *conn, u16_t len);
|
|
||||||
typedef err_t (*altcp_bind_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);
|
|
||||||
typedef err_t (*altcp_connect_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected);
|
|
||||||
|
|
||||||
typedef struct altcp_pcb *(*altcp_listen_fn)(struct altcp_pcb *conn, u8_t backlog, err_t *err);
|
|
||||||
|
|
||||||
typedef void (*altcp_abort_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef err_t (*altcp_close_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef err_t (*altcp_shutdown_fn)(struct altcp_pcb *conn, int shut_rx, int shut_tx);
|
|
||||||
|
|
||||||
typedef err_t (*altcp_write_fn)(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);
|
|
||||||
typedef err_t (*altcp_output_fn)(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
typedef u16_t (*altcp_mss_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef u16_t (*altcp_sndbuf_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef u16_t (*altcp_sndqueuelen_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef void (*altcp_nagle_disable_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef void (*altcp_nagle_enable_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef int (*altcp_nagle_disabled_fn)(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
typedef void (*altcp_setprio_fn)(struct altcp_pcb *conn, u8_t prio);
|
|
||||||
|
|
||||||
typedef void (*altcp_dealloc_fn)(struct altcp_pcb *conn);
|
|
||||||
|
|
||||||
typedef err_t (*altcp_get_tcp_addrinfo_fn)(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
|
|
||||||
typedef ip_addr_t *(*altcp_get_ip_fn)(struct altcp_pcb *conn, int local);
|
|
||||||
typedef u16_t (*altcp_get_port_fn)(struct altcp_pcb *conn, int local);
|
|
||||||
|
|
||||||
#if LWIP_TCP_KEEPALIVE
|
|
||||||
typedef void (*altcp_keepalive_disable_fn)(struct altcp_pcb *conn);
|
|
||||||
typedef void (*altcp_keepalive_enable_fn)(struct altcp_pcb *conn, u32_t idle, u32_t intvl, u32_t count);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
typedef enum tcp_state (*altcp_dbg_get_tcp_state_fn)(struct altcp_pcb *conn);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct altcp_functions {
|
|
||||||
altcp_set_poll_fn set_poll;
|
|
||||||
altcp_recved_fn recved;
|
|
||||||
altcp_bind_fn bind;
|
|
||||||
altcp_connect_fn connect;
|
|
||||||
altcp_listen_fn listen;
|
|
||||||
altcp_abort_fn abort;
|
|
||||||
altcp_close_fn close;
|
|
||||||
altcp_shutdown_fn shutdown;
|
|
||||||
altcp_write_fn write;
|
|
||||||
altcp_output_fn output;
|
|
||||||
altcp_mss_fn mss;
|
|
||||||
altcp_sndbuf_fn sndbuf;
|
|
||||||
altcp_sndqueuelen_fn sndqueuelen;
|
|
||||||
altcp_nagle_disable_fn nagle_disable;
|
|
||||||
altcp_nagle_enable_fn nagle_enable;
|
|
||||||
altcp_nagle_disabled_fn nagle_disabled;
|
|
||||||
altcp_setprio_fn setprio;
|
|
||||||
altcp_dealloc_fn dealloc;
|
|
||||||
altcp_get_tcp_addrinfo_fn addrinfo;
|
|
||||||
altcp_get_ip_fn getip;
|
|
||||||
altcp_get_port_fn getport;
|
|
||||||
#if LWIP_TCP_KEEPALIVE
|
|
||||||
altcp_keepalive_disable_fn keepalive_disable;
|
|
||||||
altcp_keepalive_enable_fn keepalive_enable;
|
|
||||||
#endif
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
altcp_dbg_get_tcp_state_fn dbg_get_tcp_state;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
void altcp_default_set_poll(struct altcp_pcb *conn, u8_t interval);
|
|
||||||
void altcp_default_recved(struct altcp_pcb *conn, u16_t len);
|
|
||||||
err_t altcp_default_bind(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);
|
|
||||||
err_t altcp_default_shutdown(struct altcp_pcb *conn, int shut_rx, int shut_tx);
|
|
||||||
err_t altcp_default_write(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);
|
|
||||||
err_t altcp_default_output(struct altcp_pcb *conn);
|
|
||||||
u16_t altcp_default_mss(struct altcp_pcb *conn);
|
|
||||||
u16_t altcp_default_sndbuf(struct altcp_pcb *conn);
|
|
||||||
u16_t altcp_default_sndqueuelen(struct altcp_pcb *conn);
|
|
||||||
void altcp_default_nagle_disable(struct altcp_pcb *conn);
|
|
||||||
void altcp_default_nagle_enable(struct altcp_pcb *conn);
|
|
||||||
int altcp_default_nagle_disabled(struct altcp_pcb *conn);
|
|
||||||
void altcp_default_setprio(struct altcp_pcb *conn, u8_t prio);
|
|
||||||
void altcp_default_dealloc(struct altcp_pcb *conn);
|
|
||||||
err_t altcp_default_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
|
|
||||||
ip_addr_t *altcp_default_get_ip(struct altcp_pcb *conn, int local);
|
|
||||||
u16_t altcp_default_get_port(struct altcp_pcb *conn, int local);
|
|
||||||
#if LWIP_TCP_KEEPALIVE
|
|
||||||
void altcp_default_keepalive_disable(struct altcp_pcb *conn);
|
|
||||||
void altcp_default_keepalive_enable(struct altcp_pcb *conn, u32_t idle, u32_t intvl, u32_t count);
|
|
||||||
#endif
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
enum tcp_state altcp_default_dbg_get_tcp_state(struct altcp_pcb *conn);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_ALTCP */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ALTCP_PRIV_H */
|
|
||||||
-272
@@ -1,272 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* netconn API lwIP internal implementations (do not use in application code)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_API_MSG_H
|
|
||||||
#define LWIP_HDR_API_MSG_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#include "lwip/arch.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
|
||||||
#include "lwip/err.h"
|
|
||||||
#include "lwip/sys.h"
|
|
||||||
#include "lwip/igmp.h"
|
|
||||||
#include "lwip/api.h"
|
|
||||||
#include "lwip/priv/tcpip_priv.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
|
|
||||||
/* Note: Netconn API is always available when sockets are enabled -
|
|
||||||
* sockets are implemented on top of them */
|
|
||||||
|
|
||||||
#if LWIP_MPU_COMPATIBLE
|
|
||||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
|
||||||
#define API_MSG_M_DEF_SEM(m) *m
|
|
||||||
#else
|
|
||||||
#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m)
|
|
||||||
#endif
|
|
||||||
#else /* LWIP_MPU_COMPATIBLE */
|
|
||||||
#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m)
|
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
|
||||||
|
|
||||||
/* For the netconn API, these values are use as a bitmask! */
|
|
||||||
#define NETCONN_SHUT_RD 1
|
|
||||||
#define NETCONN_SHUT_WR 2
|
|
||||||
#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR)
|
|
||||||
|
|
||||||
/* IP addresses and port numbers are expected to be in
|
|
||||||
* the same byte order as in the corresponding pcb.
|
|
||||||
*/
|
|
||||||
/** This struct includes everything that is necessary to execute a function
|
|
||||||
for a netconn in another thread context (mainly used to process netconns
|
|
||||||
in the tcpip_thread context to be thread safe). */
|
|
||||||
struct api_msg {
|
|
||||||
/** The netconn which to process - always needed: it includes the semaphore
|
|
||||||
which is used to block the application thread until the function finished. */
|
|
||||||
struct netconn *conn;
|
|
||||||
/** The return value of the function executed in tcpip_thread. */
|
|
||||||
err_t err;
|
|
||||||
/** Depending on the executed function, one of these union members is used */
|
|
||||||
union {
|
|
||||||
/** used for lwip_netconn_do_send */
|
|
||||||
struct netbuf *b;
|
|
||||||
/** used for lwip_netconn_do_newconn */
|
|
||||||
struct {
|
|
||||||
u8_t proto;
|
|
||||||
} n;
|
|
||||||
/** used for lwip_netconn_do_bind and lwip_netconn_do_connect */
|
|
||||||
struct {
|
|
||||||
API_MSG_M_DEF_C(ip_addr_t, ipaddr);
|
|
||||||
u16_t port;
|
|
||||||
u8_t if_idx;
|
|
||||||
} bc;
|
|
||||||
/** used for lwip_netconn_do_getaddr */
|
|
||||||
struct {
|
|
||||||
ip_addr_t API_MSG_M_DEF(ipaddr);
|
|
||||||
u16_t API_MSG_M_DEF(port);
|
|
||||||
u8_t local;
|
|
||||||
} ad;
|
|
||||||
/** used for lwip_netconn_do_write */
|
|
||||||
struct {
|
|
||||||
/** current vector to write */
|
|
||||||
const struct netvector *vector;
|
|
||||||
/** number of unwritten vectors */
|
|
||||||
u16_t vector_cnt;
|
|
||||||
/** offset into current vector */
|
|
||||||
size_t vector_off;
|
|
||||||
/** total length across vectors */
|
|
||||||
size_t len;
|
|
||||||
/** offset into total length/output of bytes written when err == ERR_OK */
|
|
||||||
size_t offset;
|
|
||||||
u8_t apiflags;
|
|
||||||
#if LWIP_SO_SNDTIMEO
|
|
||||||
u32_t time_started;
|
|
||||||
#endif /* LWIP_SO_SNDTIMEO */
|
|
||||||
} w;
|
|
||||||
/** used for lwip_netconn_do_recv */
|
|
||||||
struct {
|
|
||||||
size_t len;
|
|
||||||
} r;
|
|
||||||
#if LWIP_TCP
|
|
||||||
/** used for lwip_netconn_do_close (/shutdown) */
|
|
||||||
struct {
|
|
||||||
u8_t shut;
|
|
||||||
#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
|
|
||||||
u32_t time_started;
|
|
||||||
#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
|
||||||
u8_t polls_left;
|
|
||||||
#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
|
||||||
} sd;
|
|
||||||
#endif /* LWIP_TCP */
|
|
||||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
|
||||||
/** used for lwip_netconn_do_join_leave_group */
|
|
||||||
struct {
|
|
||||||
API_MSG_M_DEF_C(ip_addr_t, multiaddr);
|
|
||||||
API_MSG_M_DEF_C(ip_addr_t, netif_addr);
|
|
||||||
u8_t if_idx;
|
|
||||||
enum netconn_igmp join_or_leave;
|
|
||||||
} jl;
|
|
||||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
|
||||||
#if TCP_LISTEN_BACKLOG
|
|
||||||
struct {
|
|
||||||
u8_t backlog;
|
|
||||||
} lb;
|
|
||||||
#endif /* TCP_LISTEN_BACKLOG */
|
|
||||||
} msg;
|
|
||||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
|
||||||
sys_sem_t* op_completed_sem;
|
|
||||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
|
||||||
};
|
|
||||||
|
|
||||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
|
||||||
#define LWIP_API_MSG_SEM(msg) ((msg)->op_completed_sem)
|
|
||||||
#else /* LWIP_NETCONN_SEM_PER_THREAD */
|
|
||||||
#define LWIP_API_MSG_SEM(msg) (&(msg)->conn->op_completed)
|
|
||||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
|
||||||
|
|
||||||
|
|
||||||
#if LWIP_DNS
|
|
||||||
/** As lwip_netconn_do_gethostbyname requires more arguments but doesn't require a netconn,
|
|
||||||
it has its own struct (to avoid struct api_msg getting bigger than necessary).
|
|
||||||
lwip_netconn_do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg
|
|
||||||
(see netconn_gethostbyname). */
|
|
||||||
struct dns_api_msg {
|
|
||||||
/** Hostname to query or dotted IP address string */
|
|
||||||
#if LWIP_MPU_COMPATIBLE
|
|
||||||
char name[DNS_MAX_NAME_LENGTH];
|
|
||||||
#else /* LWIP_MPU_COMPATIBLE */
|
|
||||||
const char *name;
|
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
|
||||||
/** The resolved address is stored here */
|
|
||||||
ip_addr_t API_MSG_M_DEF(addr);
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
|
||||||
/** Type of resolve call */
|
|
||||||
u8_t dns_addrtype;
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
|
||||||
/** This semaphore is posted when the name is resolved, the application thread
|
|
||||||
should wait on it. */
|
|
||||||
sys_sem_t API_MSG_M_DEF_SEM(sem);
|
|
||||||
/** Errors are given back here */
|
|
||||||
err_t API_MSG_M_DEF(err);
|
|
||||||
};
|
|
||||||
#endif /* LWIP_DNS */
|
|
||||||
|
|
||||||
#if LWIP_NETCONN_FULLDUPLEX
|
|
||||||
int lwip_netconn_is_deallocated_msg(void *msg);
|
|
||||||
#endif
|
|
||||||
int lwip_netconn_is_err_msg(void *msg, err_t *err);
|
|
||||||
void lwip_netconn_do_newconn (void *m);
|
|
||||||
void lwip_netconn_do_delconn (void *m);
|
|
||||||
void lwip_netconn_do_bind (void *m);
|
|
||||||
void lwip_netconn_do_bind_if (void *m);
|
|
||||||
void lwip_netconn_do_connect (void *m);
|
|
||||||
void lwip_netconn_do_disconnect (void *m);
|
|
||||||
void lwip_netconn_do_listen (void *m);
|
|
||||||
void lwip_netconn_do_send (void *m);
|
|
||||||
void lwip_netconn_do_recv (void *m);
|
|
||||||
#if TCP_LISTEN_BACKLOG
|
|
||||||
void lwip_netconn_do_accepted (void *m);
|
|
||||||
#endif /* TCP_LISTEN_BACKLOG */
|
|
||||||
void lwip_netconn_do_write (void *m);
|
|
||||||
void lwip_netconn_do_getaddr (void *m);
|
|
||||||
void lwip_netconn_do_close (void *m);
|
|
||||||
void lwip_netconn_do_shutdown (void *m);
|
|
||||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
|
||||||
void lwip_netconn_do_join_leave_group(void *m);
|
|
||||||
void lwip_netconn_do_join_leave_group_netif(void *m);
|
|
||||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
|
||||||
|
|
||||||
#if LWIP_DNS
|
|
||||||
void lwip_netconn_do_gethostbyname(void *arg);
|
|
||||||
#endif /* LWIP_DNS */
|
|
||||||
|
|
||||||
struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback);
|
|
||||||
void netconn_free(struct netconn *conn);
|
|
||||||
|
|
||||||
#endif /* LWIP_NETCONN || LWIP_SOCKET */
|
|
||||||
|
|
||||||
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
/* netifapi related lwIP internal definitions */
|
|
||||||
|
|
||||||
#if LWIP_MPU_COMPATIBLE
|
|
||||||
#define NETIFAPI_IPADDR_DEF(type, m) type m
|
|
||||||
#else /* LWIP_MPU_COMPATIBLE */
|
|
||||||
#define NETIFAPI_IPADDR_DEF(type, m) const type * m
|
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
|
||||||
|
|
||||||
typedef void (*netifapi_void_fn)(struct netif *netif);
|
|
||||||
typedef err_t (*netifapi_errt_fn)(struct netif *netif);
|
|
||||||
|
|
||||||
struct netifapi_msg {
|
|
||||||
struct tcpip_api_call_data call;
|
|
||||||
struct netif *netif;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
#if LWIP_IPV4
|
|
||||||
NETIFAPI_IPADDR_DEF(ip4_addr_t, ipaddr);
|
|
||||||
NETIFAPI_IPADDR_DEF(ip4_addr_t, netmask);
|
|
||||||
NETIFAPI_IPADDR_DEF(ip4_addr_t, gw);
|
|
||||||
#endif /* LWIP_IPV4 */
|
|
||||||
void *state;
|
|
||||||
netif_init_fn init;
|
|
||||||
netif_input_fn input;
|
|
||||||
} add;
|
|
||||||
struct {
|
|
||||||
netifapi_void_fn voidfunc;
|
|
||||||
netifapi_errt_fn errtfunc;
|
|
||||||
} common;
|
|
||||||
struct {
|
|
||||||
#if LWIP_MPU_COMPATIBLE
|
|
||||||
char name[NETIF_NAMESIZE];
|
|
||||||
#else /* LWIP_MPU_COMPATIBLE */
|
|
||||||
char *name;
|
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
|
||||||
u8_t index;
|
|
||||||
} ifs;
|
|
||||||
} msg;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* LWIP_NETIF_API */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_API_MSG_H */
|
|
||||||
-84
@@ -1,84 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP internal memory implementations (do not use in application code)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_MEM_PRIV_H
|
|
||||||
#define LWIP_HDR_MEM_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "lwip/mem.h"
|
|
||||||
|
|
||||||
#if MEM_OVERFLOW_CHECK || MEMP_OVERFLOW_CHECK
|
|
||||||
/* if MEM_OVERFLOW_CHECK or MEMP_OVERFLOW_CHECK is turned on, we reserve some
|
|
||||||
* bytes at the beginning and at the end of each element, initialize them as
|
|
||||||
* 0xcd and check them later.
|
|
||||||
* If MEM(P)_OVERFLOW_CHECK is >= 2, on every call to mem(p)_malloc or mem(p)_free,
|
|
||||||
* every single element in each pool/heap is checked!
|
|
||||||
* This is VERY SLOW but also very helpful.
|
|
||||||
* MEM_SANITY_REGION_BEFORE and MEM_SANITY_REGION_AFTER can be overridden in
|
|
||||||
* lwipopts.h to change the amount reserved for checking. */
|
|
||||||
#ifndef MEM_SANITY_REGION_BEFORE
|
|
||||||
#define MEM_SANITY_REGION_BEFORE 16
|
|
||||||
#endif /* MEM_SANITY_REGION_BEFORE*/
|
|
||||||
#if MEM_SANITY_REGION_BEFORE > 0
|
|
||||||
#define MEM_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEM_SANITY_REGION_BEFORE)
|
|
||||||
#else
|
|
||||||
#define MEM_SANITY_REGION_BEFORE_ALIGNED 0
|
|
||||||
#endif /* MEM_SANITY_REGION_BEFORE*/
|
|
||||||
#ifndef MEM_SANITY_REGION_AFTER
|
|
||||||
#define MEM_SANITY_REGION_AFTER 16
|
|
||||||
#endif /* MEM_SANITY_REGION_AFTER*/
|
|
||||||
#if MEM_SANITY_REGION_AFTER > 0
|
|
||||||
#define MEM_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEM_SANITY_REGION_AFTER)
|
|
||||||
#else
|
|
||||||
#define MEM_SANITY_REGION_AFTER_ALIGNED 0
|
|
||||||
#endif /* MEM_SANITY_REGION_AFTER*/
|
|
||||||
|
|
||||||
void mem_overflow_init_raw(void *p, size_t size);
|
|
||||||
void mem_overflow_check_raw(void *p, size_t size, const char *descr1, const char *descr2);
|
|
||||||
|
|
||||||
#endif /* MEM_OVERFLOW_CHECK || MEMP_OVERFLOW_CHECK */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MEMP_PRIV_H */
|
|
||||||
-161
@@ -1,161 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* memory pools lwIP internal implementations (do not use in application code)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_MEMP_PRIV_H
|
|
||||||
#define LWIP_HDR_MEMP_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "lwip/mem.h"
|
|
||||||
#include "lwip/priv/mem_priv.h"
|
|
||||||
|
|
||||||
#if MEMP_OVERFLOW_CHECK
|
|
||||||
|
|
||||||
|
|
||||||
/* MEMP_SIZE: save space for struct memp and for sanity check */
|
|
||||||
#define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEM_SANITY_REGION_BEFORE_ALIGNED)
|
|
||||||
#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEM_SANITY_REGION_AFTER_ALIGNED)
|
|
||||||
|
|
||||||
#else /* MEMP_OVERFLOW_CHECK */
|
|
||||||
|
|
||||||
/* No sanity checks
|
|
||||||
* We don't need to preserve the struct memp while not allocated, so we
|
|
||||||
* can save a little space and set MEMP_SIZE to 0.
|
|
||||||
*/
|
|
||||||
#define MEMP_SIZE 0
|
|
||||||
#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
|
|
||||||
|
|
||||||
#endif /* MEMP_OVERFLOW_CHECK */
|
|
||||||
|
|
||||||
#if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK
|
|
||||||
struct memp {
|
|
||||||
struct memp *next;
|
|
||||||
#if MEMP_OVERFLOW_CHECK
|
|
||||||
const char *file;
|
|
||||||
int line;
|
|
||||||
#endif /* MEMP_OVERFLOW_CHECK */
|
|
||||||
};
|
|
||||||
#endif /* !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK */
|
|
||||||
|
|
||||||
#if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS
|
|
||||||
/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */
|
|
||||||
typedef enum {
|
|
||||||
/* Get the first (via:
|
|
||||||
MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/
|
|
||||||
MEMP_POOL_HELPER_FIRST = ((u8_t)
|
|
||||||
#define LWIP_MEMPOOL(name,num,size,desc)
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_START 1
|
|
||||||
#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_END
|
|
||||||
#include "lwip/priv/memp_std.h"
|
|
||||||
) ,
|
|
||||||
/* Get the last (via:
|
|
||||||
MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */
|
|
||||||
MEMP_POOL_HELPER_LAST = ((u8_t)
|
|
||||||
#define LWIP_MEMPOOL(name,num,size,desc)
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_START
|
|
||||||
#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_END 1
|
|
||||||
#include "lwip/priv/memp_std.h"
|
|
||||||
)
|
|
||||||
} memp_pool_helper_t;
|
|
||||||
|
|
||||||
/* The actual start and stop values are here (cast them over)
|
|
||||||
We use this helper type and these defines so we can avoid using const memp_t values */
|
|
||||||
#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
|
|
||||||
#define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST)
|
|
||||||
#endif /* MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS */
|
|
||||||
|
|
||||||
/** Memory pool descriptor */
|
|
||||||
struct memp_desc {
|
|
||||||
#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
|
|
||||||
/** Textual description */
|
|
||||||
const char *desc;
|
|
||||||
#endif /* LWIP_DEBUG || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY */
|
|
||||||
#if MEMP_STATS
|
|
||||||
/** Statistics */
|
|
||||||
struct stats_mem *stats;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Element size */
|
|
||||||
u16_t size;
|
|
||||||
|
|
||||||
#if !MEMP_MEM_MALLOC
|
|
||||||
/** Number of elements */
|
|
||||||
u16_t num;
|
|
||||||
|
|
||||||
/** Base address */
|
|
||||||
u8_t *base;
|
|
||||||
|
|
||||||
/** First free element of each pool. Elements form a linked list. */
|
|
||||||
struct memp **tab;
|
|
||||||
#endif /* MEMP_MEM_MALLOC */
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
|
|
||||||
#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),
|
|
||||||
#else
|
|
||||||
#define DECLARE_LWIP_MEMPOOL_DESC(desc)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MEMP_STATS
|
|
||||||
#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name;
|
|
||||||
#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name,
|
|
||||||
#else
|
|
||||||
#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name)
|
|
||||||
#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void memp_init_pool(const struct memp_desc *desc);
|
|
||||||
|
|
||||||
#if MEMP_OVERFLOW_CHECK
|
|
||||||
void *memp_malloc_pool_fn(const struct memp_desc* desc, const char* file, const int line);
|
|
||||||
#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)
|
|
||||||
#else
|
|
||||||
void *memp_malloc_pool(const struct memp_desc *desc);
|
|
||||||
#endif
|
|
||||||
void memp_free_pool(const struct memp_desc* desc, void *mem);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_MEMP_PRIV_H */
|
|
||||||
-153
@@ -1,153 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* lwIP internal memory pools (do not use in application code)
|
|
||||||
* This file is deliberately included multiple times: once with empty
|
|
||||||
* definition of LWIP_MEMPOOL() to handle all includes and multiple times
|
|
||||||
* to build up various lists of mem pools.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SETUP: Make sure we define everything we will need.
|
|
||||||
*
|
|
||||||
* We have create three types of pools:
|
|
||||||
* 1) MEMPOOL - standard pools
|
|
||||||
* 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c
|
|
||||||
* 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct
|
|
||||||
*
|
|
||||||
* If the include'r doesn't require any special treatment of each of the types
|
|
||||||
* above, then will declare #2 & #3 to be just standard mempools.
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_MALLOC_MEMPOOL
|
|
||||||
/* This treats "malloc pools" just like any other pool.
|
|
||||||
The pools are a little bigger to provide 'size' as the amount of user data. */
|
|
||||||
#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))), "MALLOC_"#size)
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_START
|
|
||||||
#define LWIP_MALLOC_MEMPOOL_END
|
|
||||||
#endif /* LWIP_MALLOC_MEMPOOL */
|
|
||||||
|
|
||||||
#ifndef LWIP_PBUF_MEMPOOL
|
|
||||||
/* This treats "pbuf pools" just like any other pool.
|
|
||||||
* Allocates buffers for a pbuf struct AND a payload size */
|
|
||||||
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) + LWIP_MEM_ALIGN_SIZE(payload)), desc)
|
|
||||||
#endif /* LWIP_PBUF_MEMPOOL */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A list of internal pools used by LWIP.
|
|
||||||
*
|
|
||||||
* LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description)
|
|
||||||
* creates a pool name MEMP_pool_name. description is used in stats.c
|
|
||||||
*/
|
|
||||||
#if LWIP_RAW
|
|
||||||
LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB")
|
|
||||||
#endif /* LWIP_RAW */
|
|
||||||
|
|
||||||
#if LWIP_UDP
|
|
||||||
LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB")
|
|
||||||
#endif /* LWIP_UDP */
|
|
||||||
|
|
||||||
#if LWIP_TCP
|
|
||||||
LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB")
|
|
||||||
LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN")
|
|
||||||
LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG")
|
|
||||||
#endif /* LWIP_TCP */
|
|
||||||
|
|
||||||
#if LWIP_ALTCP && LWIP_TCP
|
|
||||||
LWIP_MEMPOOL(ALTCP_PCB, MEMP_NUM_ALTCP_PCB, sizeof(struct altcp_pcb), "ALTCP_PCB")
|
|
||||||
#endif /* LWIP_ALTCP && LWIP_TCP */
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && IP_REASSEMBLY
|
|
||||||
LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA")
|
|
||||||
#endif /* LWIP_IPV4 && IP_REASSEMBLY */
|
|
||||||
#if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)
|
|
||||||
LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF")
|
|
||||||
#endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */
|
|
||||||
|
|
||||||
#if LWIP_NETCONN || LWIP_SOCKET
|
|
||||||
LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF")
|
|
||||||
LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN")
|
|
||||||
#endif /* LWIP_NETCONN || LWIP_SOCKET */
|
|
||||||
|
|
||||||
#if NO_SYS==0
|
|
||||||
LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API")
|
|
||||||
#if LWIP_MPU_COMPATIBLE
|
|
||||||
LWIP_MEMPOOL(API_MSG, MEMP_NUM_API_MSG, sizeof(struct api_msg), "API_MSG")
|
|
||||||
#if LWIP_DNS
|
|
||||||
LWIP_MEMPOOL(DNS_API_MSG, MEMP_NUM_DNS_API_MSG, sizeof(struct dns_api_msg), "DNS_API_MSG")
|
|
||||||
#endif
|
|
||||||
#if LWIP_SOCKET && !LWIP_TCPIP_CORE_LOCKING
|
|
||||||
LWIP_MEMPOOL(SOCKET_SETGETSOCKOPT_DATA, MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA, sizeof(struct lwip_setgetsockopt_data), "SOCKET_SETGETSOCKOPT_DATA")
|
|
||||||
#endif
|
|
||||||
#if LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL)
|
|
||||||
LWIP_MEMPOOL(SELECT_CB, MEMP_NUM_SELECT_CB, sizeof(struct lwip_select_cb), "SELECT_CB")
|
|
||||||
#endif /* LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL) */
|
|
||||||
#if LWIP_NETIF_API
|
|
||||||
LWIP_MEMPOOL(NETIFAPI_MSG, MEMP_NUM_NETIFAPI_MSG, sizeof(struct netifapi_msg), "NETIFAPI_MSG")
|
|
||||||
#endif
|
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
|
||||||
#if !LWIP_TCPIP_CORE_LOCKING_INPUT
|
|
||||||
LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT")
|
|
||||||
#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
|
|
||||||
#endif /* NO_SYS==0 */
|
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING
|
|
||||||
LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE")
|
|
||||||
#endif /* LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING */
|
|
||||||
|
|
||||||
#if LWIP_IGMP
|
|
||||||
LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP")
|
|
||||||
#endif /* LWIP_IGMP */
|
|
||||||
|
|
||||||
#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM
|
|
||||||
LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT")
|
|
||||||
#endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */
|
|
||||||
|
|
||||||
#if LWIP_DNS && LWIP_SOCKET
|
|
||||||
LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB")
|
|
||||||
#endif /* LWIP_DNS && LWIP_SOCKET */
|
|
||||||
#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
|
||||||
LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST")
|
|
||||||
#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_ND6_QUEUEING
|
|
||||||
LWIP_MEMPOOL(ND6_QUEUE, MEMP_NUM_ND6_QUEUE, sizeof(struct nd6_q_entry), "ND6_QUEUE")
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_ND6_QUEUEING */
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_REASS
|
|
||||||
LWIP_MEMPOOL(IP6_REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip6_reassdata), "IP6_REASSDATA")
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */
|
|
||||||
|
|
||||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
|
||||||
LWIP_MEMPOOL(MLD6_GROUP, MEMP_NUM_MLD6_GROUP, sizeof(struct mld_group), "MLD6_GROUP")
|
|
||||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A list of pools of pbuf's used by LWIP.
|
|
||||||
*
|
|
||||||
* LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description)
|
|
||||||
* creates a pool name MEMP_pool_name. description is used in stats.c
|
|
||||||
* This allocates enough space for the pbuf struct and a payload.
|
|
||||||
* (Example: pbuf_payload_size=0 allocates only size for the struct)
|
|
||||||
*/
|
|
||||||
LWIP_MEMPOOL(PBUF, MEMP_NUM_PBUF, sizeof(struct pbuf), "PBUF_REF/ROM")
|
|
||||||
LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL")
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allow for user-defined pools; this must be explicitly set in lwipopts.h
|
|
||||||
* since the default is to NOT look for lwippools.h
|
|
||||||
*/
|
|
||||||
#if MEMP_USE_CUSTOM_POOLS
|
|
||||||
#include "lwippools.h"
|
|
||||||
#endif /* MEMP_USE_CUSTOM_POOLS */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later
|
|
||||||
* (#undef is ignored for something that is not defined)
|
|
||||||
*/
|
|
||||||
#undef LWIP_MEMPOOL
|
|
||||||
#undef LWIP_MALLOC_MEMPOOL
|
|
||||||
#undef LWIP_MALLOC_MEMPOOL_START
|
|
||||||
#undef LWIP_MALLOC_MEMPOOL_END
|
|
||||||
#undef LWIP_PBUF_MEMPOOL
|
|
||||||
-142
@@ -1,142 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* Neighbor discovery and stateless address autoconfiguration for IPv6.
|
|
||||||
* Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862
|
|
||||||
* (Address autoconfiguration).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2010 Inico Technologies Ltd.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Ivan Delamer <delamer@inicotech.com>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Please coordinate changes and requests with Ivan Delamer
|
|
||||||
* <delamer@inicotech.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LWIP_HDR_ND6_PRIV_H
|
|
||||||
#define LWIP_HDR_ND6_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/pbuf.h"
|
|
||||||
#include "lwip/ip6_addr.h"
|
|
||||||
#include "lwip/netif.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LWIP_ND6_QUEUEING
|
|
||||||
/** struct for queueing outgoing packets for unknown address
|
|
||||||
* defined here to be accessed by memp.h
|
|
||||||
*/
|
|
||||||
struct nd6_q_entry {
|
|
||||||
struct nd6_q_entry *next;
|
|
||||||
struct pbuf *p;
|
|
||||||
};
|
|
||||||
#endif /* LWIP_ND6_QUEUEING */
|
|
||||||
|
|
||||||
/** Struct for tables. */
|
|
||||||
struct nd6_neighbor_cache_entry {
|
|
||||||
ip6_addr_t next_hop_address;
|
|
||||||
struct netif *netif;
|
|
||||||
u8_t lladdr[NETIF_MAX_HWADDR_LEN];
|
|
||||||
/*u32_t pmtu;*/
|
|
||||||
#if LWIP_ND6_QUEUEING
|
|
||||||
/** Pointer to queue of pending outgoing packets on this entry. */
|
|
||||||
struct nd6_q_entry *q;
|
|
||||||
#else /* LWIP_ND6_QUEUEING */
|
|
||||||
/** Pointer to a single pending outgoing packet on this entry. */
|
|
||||||
struct pbuf *q;
|
|
||||||
#endif /* LWIP_ND6_QUEUEING */
|
|
||||||
u8_t state;
|
|
||||||
u8_t isrouter;
|
|
||||||
union {
|
|
||||||
u32_t reachable_time; /* in seconds */
|
|
||||||
u32_t delay_time; /* ticks (ND6_TMR_INTERVAL) */
|
|
||||||
u32_t probes_sent;
|
|
||||||
u32_t stale_time; /* ticks (ND6_TMR_INTERVAL) */
|
|
||||||
} counter;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct nd6_destination_cache_entry {
|
|
||||||
ip6_addr_t destination_addr;
|
|
||||||
ip6_addr_t next_hop_addr;
|
|
||||||
u16_t pmtu;
|
|
||||||
u32_t age;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct nd6_prefix_list_entry {
|
|
||||||
ip6_addr_t prefix;
|
|
||||||
struct netif *netif;
|
|
||||||
u32_t invalidation_timer; /* in seconds */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct nd6_router_list_entry {
|
|
||||||
struct nd6_neighbor_cache_entry *neighbor_entry;
|
|
||||||
u32_t invalidation_timer; /* in seconds */
|
|
||||||
u8_t flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum nd6_neighbor_cache_entry_state {
|
|
||||||
ND6_NO_ENTRY = 0,
|
|
||||||
ND6_INCOMPLETE,
|
|
||||||
ND6_REACHABLE,
|
|
||||||
ND6_STALE,
|
|
||||||
ND6_DELAY,
|
|
||||||
ND6_PROBE
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ND6_HOPLIM 255 /* maximum hop limit, required in all ND packets */
|
|
||||||
|
|
||||||
#define ND6_2HRS 7200 /* two hours, expressed in number of seconds */
|
|
||||||
|
|
||||||
/* Router tables. */
|
|
||||||
/* @todo make these static? and entries accessible through API? */
|
|
||||||
extern struct nd6_neighbor_cache_entry neighbor_cache[];
|
|
||||||
extern struct nd6_destination_cache_entry destination_cache[];
|
|
||||||
extern struct nd6_prefix_list_entry prefix_list[];
|
|
||||||
extern struct nd6_router_list_entry default_router_list[];
|
|
||||||
|
|
||||||
/* Default values, can be updated by a RA message. */
|
|
||||||
extern u32_t reachable_time;
|
|
||||||
extern u32_t retrans_timer;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_ND6_PRIV_H */
|
|
||||||
-69
@@ -1,69 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file
|
|
||||||
* raw API internal implementations (do not use in application code)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
* OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
|
||||||
*
|
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef LWIP_HDR_RAW_PRIV_H
|
|
||||||
#define LWIP_HDR_RAW_PRIV_H
|
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
|
||||||
|
|
||||||
#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
|
|
||||||
|
|
||||||
#include "lwip/raw.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** return codes for raw_input */
|
|
||||||
typedef enum raw_input_state
|
|
||||||
{
|
|
||||||
RAW_INPUT_NONE = 0, /* pbuf did not match any pcbs */
|
|
||||||
RAW_INPUT_EATEN, /* pbuf handed off and delivered to pcb */
|
|
||||||
RAW_INPUT_DELIVERED /* pbuf only delivered to pcb (pbuf can still be referenced) */
|
|
||||||
} raw_input_state_t;
|
|
||||||
|
|
||||||
/* The following functions are the lower layer interface to RAW. */
|
|
||||||
raw_input_state_t raw_input(struct pbuf *p, struct netif *inp);
|
|
||||||
|
|
||||||
void raw_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LWIP_RAW */
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_RAW_PRIV_H */
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user