Compare commits

...

4 Commits
main ... main

4 changed files with 921 additions and 0 deletions

390
StatsDiagramme.drawio Normal file
View File

@ -0,0 +1,390 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" version="24.7.17">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="759" dy="783" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="get_ping_from..." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="104" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-6" value="p_reg==NULL" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="104" y="130" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-2" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="MnLx8wzq2r3ptjONxLro-11" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="194" y="340" as="sourcePoint" />
<mxPoint x="274" y="170" as="targetPoint" />
<Array as="points">
<mxPoint x="284" y="155" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-4" value="&lt;div&gt;Non&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-2" vertex="1" connectable="0">
<mxGeometry x="0.0114" y="2" relative="1" as="geometry">
<mxPoint x="-23" y="9" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-3" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="WIyWlLk6GJQsqaUBKTNV-3" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="194" y="240" as="sourcePoint" />
<mxPoint x="244" y="190" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-5" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="14" y="200" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="MnLx8wzq2r3ptjONxLro-5" target="MnLx8wzq2r3ptjONxLro-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-8" value="" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="MnLx8wzq2r3ptjONxLro-5" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="194" y="240" as="sourcePoint" />
<mxPoint x="244" y="190" as="targetPoint" />
<Array as="points">
<mxPoint x="44" y="155" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-9" value="Oui" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-8" vertex="1" connectable="0">
<mxGeometry x="0.5246" y="-2" relative="1" as="geometry">
<mxPoint y="-2" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-11" value="fd==NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="244" y="180" width="80" height="50" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-12" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.469;exitY=-0.136;exitDx=0;exitDy=0;exitPerimeter=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="194.14" y="237.27999999999997" as="sourcePoint" />
<mxPoint x="246" y="205" as="targetPoint" />
<Array as="points">
<mxPoint x="194" y="205" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-13" value="regcomp..." style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="335" y="247" width="80" height="50" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-14" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="MnLx8wzq2r3ptjONxLro-11" target="MnLx8wzq2r3ptjONxLro-13" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="214" y="215" as="sourcePoint" />
<mxPoint x="254" y="215" as="targetPoint" />
<Array as="points">
<mxPoint x="374" y="205" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-15" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-14" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-18" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="164" y="237" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-19" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="334" y="329" as="sourcePoint" />
<mxPoint x="384" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="384" y="329" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-20" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-19" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="8" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-21" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.469;exitY=-0.136;exitDx=0;exitDy=0;exitPerimeter=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="283.14" y="304.28" as="sourcePoint" />
<mxPoint x="335" y="272" as="targetPoint" />
<Array as="points">
<mxPoint x="283" y="272" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-22" value="p_reg!=NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="234" y="304" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-23" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.469;exitY=-0.136;exitDx=0;exitDy=0;exitPerimeter=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="184.14" y="361.28" as="sourcePoint" />
<mxPoint x="236" y="329" as="targetPoint" />
<Array as="points">
<mxPoint x="184" y="329" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-25" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="MnLx8wzq2r3ptjONxLro-31" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="416" y="272" as="sourcePoint" />
<mxPoint x="467" y="314" as="targetPoint" />
<Array as="points">
<mxPoint x="466" y="272" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-26" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-25" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-27" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="150" y="360" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-31" value="pmatch==NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="412" y="370" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-35" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="362" y="420" as="sourcePoint" />
<mxPoint x="414" y="397" as="targetPoint" />
<Array as="points">
<mxPoint x="362" y="397" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-36" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="334" y="420" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-39" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="522" y="397" as="sourcePoint" />
<mxPoint x="572" y="430" as="targetPoint" />
<Array as="points">
<mxPoint x="572" y="397" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-40" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-39" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-0" value="while getline..." style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="517" y="430" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-3" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1" source="KtpHkUNzCtoxH49DRxn0-4">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="374" y="489" as="sourcePoint" />
<mxPoint x="518" y="457" as="targetPoint" />
<Array as="points">
<mxPoint x="318" y="457" />
<mxPoint x="466" y="457" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-4" value="read_line = NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="253" y="490" width="130" height="54" as="geometry" />
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-5" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="384" y="517" as="sourcePoint" />
<mxPoint x="458" y="560" as="targetPoint" />
<Array as="points">
<mxPoint x="458" y="517" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-6" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="KtpHkUNzCtoxH49DRxn0-5" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-7" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.0169" width="50" height="50" relative="1" as="geometry">
<mxPoint x="238" y="550" as="sourcePoint" />
<mxPoint x="254" y="517" as="targetPoint" />
<Array as="points">
<mxPoint x="238" y="517" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-13" value="regexec..." style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="403" y="559" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-0" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="627" y="457" as="sourcePoint" />
<mxPoint x="665" y="500" as="targetPoint" />
<Array as="points">
<mxPoint x="665" y="457" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-1" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-2" value="read_line !=NULL" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="594" y="500" width="140" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-3" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="734" y="527" as="sourcePoint" />
<mxPoint x="772" y="570" as="targetPoint" />
<Array as="points">
<mxPoint x="772" y="527" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-4" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-3">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-5" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="224" y="690" as="sourcePoint" />
<mxPoint x="244" y="647" as="targetPoint" />
<Array as="points">
<mxPoint x="224" y="647" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-7" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="550" y="570" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-9" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="743" y="570" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-10" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="355" y="354" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-11" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="513" y="586" as="sourcePoint" />
<mxPoint x="537" y="629" as="targetPoint" />
<Array as="points">
<mxPoint x="537" y="586" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-12" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-11">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="10" y="16" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-15" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="606" y="656" as="sourcePoint" />
<mxPoint x="630" y="699" as="targetPoint" />
<Array as="points">
<mxPoint x="630" y="656" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-16" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-15">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="12" y="20" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-17" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="577" y="570" as="sourcePoint" />
<mxPoint x="597" y="527" as="targetPoint" />
<Array as="points">
<mxPoint x="577" y="527" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-18" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="418" y="699" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-19" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="0.1017" width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="620" as="sourcePoint" />
<mxPoint x="403" y="586" as="targetPoint" />
<Array as="points">
<mxPoint x="300" y="586" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-20" value="ping==NULL" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="245" y="620" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-21" value="read_line !=NULL" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="466" y="629" width="140" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-22" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="448" y="699" as="sourcePoint" />
<mxPoint x="468" y="656" as="targetPoint" />
<Array as="points">
<mxPoint x="448" y="656" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-23" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="600" y="699" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-25" value="Break" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="209" y="550" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-26" value="Break" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="194" y="690" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-27" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="352" y="647" as="sourcePoint" />
<mxPoint x="376" y="750" as="targetPoint" />
<Array as="points">
<mxPoint x="376" y="647" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-28" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-27">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="10" y="16" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-33" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="446" y="777" as="sourcePoint" />
<mxPoint x="470" y="820" as="targetPoint" />
<Array as="points">
<mxPoint x="470" y="777" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-34" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="Y5Nk2htjNUXdQ5s2E8ia-33">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="12" y="20" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-35" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="258" y="820" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-36" value="read_line !=NULL" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="306" y="750" width="140" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-37" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="288" y="820" as="sourcePoint" />
<mxPoint x="308" y="777" as="targetPoint" />
<Array as="points">
<mxPoint x="288" y="777" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-38" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="440" y="820" width="60" height="20" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -0,0 +1,43 @@
TP2 "Quantité de route"
LAWSON-LARTEGO EMMANUELLA
Nathan Bouzon
ping =-report.c
Compléxité cyclomatique
main/ 4
db-sqlite.c
Compléxité cyclomatique
db_connect/ 1
db_disconnect/ 1
insert_hourly_report/ 1
Utils.c
Compléxité cyclomatique
write_pid_file/ 2
remove_file/ 1
daemon.c
Compléxité cyclomatique
create_daemon/ 4
ping_request/ 2
send_check/ 4
check_keep_working/ 4
daemon_work/ 2
Stats.c
Compléxité cyclomatique
get_ping_from_temp_log/ 11
write_ping_log / 4
set_stats_ping / 25
Analyse statique (Compléxité cyclomatique)
-Pas de besoin de lancer le code
Analyse dynamique (Profiling)
-Besoin de démarer le code pour faire l'analyse
ELOC = Ligne de code utilisé
LOC = Ligne de code

View File

@ -0,0 +1,238 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" version="24.7.17">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1366" dy="714" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="get_ping_from..." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="122" y="38" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-3" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-3" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="182" y="118" as="sourcePoint" />
<mxPoint x="262" y="178" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="44" y="220" as="sourcePoint" />
<mxPoint x="44" y="220" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-11" value="fd==NULL || p_reg==NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="115" y="118" width="134" height="80" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-12" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.469;exitY=-0.136;exitDx=0;exitDy=0;exitPerimeter=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1" target="MnLx8wzq2r3ptjONxLro-11">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="62.139999999999986" y="205.27999999999997" as="sourcePoint" />
<mxPoint x="114" y="173" as="targetPoint" />
<Array as="points">
<mxPoint x="62" y="158" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-13" value="regcomp..." style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="260" y="215" width="80" height="50" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-14" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="MnLx8wzq2r3ptjONxLro-11" target="MnLx8wzq2r3ptjONxLro-13" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="139" y="183" as="sourcePoint" />
<mxPoint x="179" y="183" as="targetPoint" />
<Array as="points">
<mxPoint x="300" y="158" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-15" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-14" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-18" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="32" y="205" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-21" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.469;exitY=-0.136;exitDx=0;exitDy=0;exitPerimeter=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="208.14" y="272.28" as="sourcePoint" />
<mxPoint x="260" y="240" as="targetPoint" />
<Array as="points">
<mxPoint x="208" y="240" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-25" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="MnLx8wzq2r3ptjONxLro-31" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="341" y="240" as="sourcePoint" />
<mxPoint x="392" y="282" as="targetPoint" />
<Array as="points">
<mxPoint x="391" y="240" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-26" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-25" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-27" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="179" y="267" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-31" value="pmatch==NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="337" y="338" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-35" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.2881" width="50" height="50" relative="1" as="geometry">
<mxPoint x="287" y="388" as="sourcePoint" />
<mxPoint x="339" y="365" as="targetPoint" />
<Array as="points">
<mxPoint x="287" y="365" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-36" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="259" y="388" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-39" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="447" y="365" as="sourcePoint" />
<mxPoint x="497" y="398" as="targetPoint" />
<Array as="points">
<mxPoint x="497" y="365" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="MnLx8wzq2r3ptjONxLro-40" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="MnLx8wzq2r3ptjONxLro-39" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-4" value="read_line = NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="432" y="398" width="130" height="54" as="geometry" />
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-5" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="563" y="425" as="sourcePoint" />
<mxPoint x="637" y="468" as="targetPoint" />
<Array as="points">
<mxPoint x="637" y="425" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-6" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="KtpHkUNzCtoxH49DRxn0-5" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-7" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.0169" width="50" height="50" relative="1" as="geometry">
<mxPoint x="417" y="458" as="sourcePoint" />
<mxPoint x="433" y="425" as="targetPoint" />
<Array as="points">
<mxPoint x="417" y="425" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KtpHkUNzCtoxH49DRxn0-13" value="regexec..." style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="583" y="468" width="110" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-2" value="read_line !=NULL" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="647" y="577" width="140" height="54" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-3" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="787" y="604" as="sourcePoint" />
<mxPoint x="825" y="647" as="targetPoint" />
<Array as="points">
<mxPoint x="825" y="604" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-4" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Y5Nk2htjNUXdQ5s2E8ia-3" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-7" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="603" y="647" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-9" value="Return" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="796" y="647" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-11" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1" target="Y5Nk2htjNUXdQ5s2E8ia-2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="693" y="495" as="sourcePoint" />
<mxPoint x="717" y="538" as="targetPoint" />
<Array as="points">
<mxPoint x="717" y="495" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-12" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Y5Nk2htjNUXdQ5s2E8ia-11" vertex="1" connectable="0">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="10" y="16" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-17" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="630" y="647" as="sourcePoint" />
<mxPoint x="650" y="604" as="targetPoint" />
<Array as="points">
<mxPoint x="630" y="604" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-19" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" edge="1">
<mxGeometry x="0.1017" width="50" height="50" relative="1" as="geometry">
<mxPoint x="480" y="529" as="sourcePoint" />
<mxPoint x="583" y="495" as="targetPoint" />
<Array as="points">
<mxPoint x="480" y="495" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Y5Nk2htjNUXdQ5s2E8ia-25" value="Break" style="ellipse;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="388" y="458" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-2" value="read_line !=NULL" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="410" y="530" width="140" height="54" as="geometry" />
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-3" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="550" y="557" as="sourcePoint" />
<mxPoint x="588" y="600" as="targetPoint" />
<Array as="points">
<mxPoint x="588" y="557" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-4" value="Non" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="0DRFjRBlOVL2ZS2CEGVx-3">
<mxGeometry x="-0.6019" relative="1" as="geometry">
<mxPoint x="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-5" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="366" y="600" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-6" value="Return" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="559" y="600" width="60" height="20" as="geometry" />
</mxCell>
<mxCell id="0DRFjRBlOVL2ZS2CEGVx-7" value="Oui" style="endArrow=none;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="-0.0917" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="393" y="600" as="sourcePoint" />
<mxPoint x="413" y="557" as="targetPoint" />
<Array as="points">
<mxPoint x="393" y="557" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -0,0 +1,250 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <regex.h>
#include "../include/utils.h"
#include "../include/stats.h"
#include "../include/db-sqlite.h"
/*
-- get_ping_from_temp_log --
Desc :
Function which get the ping from a temp log containing the last ping did by the program
In-param :
None
Out-param :
None
Return value :
Ping value as a string or NULL if an error occured
*/
/*@null@*/char* get_ping_from_temp_log(){
/* Variables */
FILE* fd = NULL;
char* read_line = NULL;
size_t n = 0;
size_t nmatch = 2;
regex_t *p_reg;
regmatch_t* pmatch;
char* ping = NULL;
int start;
int end;
size_t size_ping;
/* regex struct memory allocation */
p_reg = (regex_t *) malloc(sizeof(*p_reg));
/*
if (p_reg== NULL){
return ping; /NULL/
}
*/
/* Open ping log file */
fd = fopen("/var/log/ping-report/last-ping.log","r");
if(fd == NULL || p_reg == NULL){ //++
free(p_reg);
return ping; /* NULL */
}
/* Construct regex to get ping from log file */
if(regcomp(p_reg,"time=(.*) ms",REG_EXTENDED) != 0 && p_reg != NULL){
free(p_reg);
(void) fclose(fd);
return ping; /* NULL */
}
/* match info memory allocation */
pmatch = malloc(sizeof(*pmatch) * nmatch);
if(pmatch == NULL){
(void) fclose(fd);
regfree(p_reg);
free(p_reg);
return ping; /* NULL */
}
/* Read file */
//while(getline(&read_line,&n,fd) != -1){
if(read_line == NULL){
break;
}
/* Exec regex to find ping */
if(regexec(p_reg,read_line,nmatch,pmatch,0) == 0){
/* Extract ping position from read line */
start = (int) pmatch[1].rm_so;
end = (int) pmatch[1].rm_eo;
size_ping = (size_t) (end - start);
/* ping string memory allocation */
ping = malloc(sizeof(char) * (size_ping+2));
/* if(ping == NULL){
free(read_line);
read_line = NULL;
n = 0;
break;
} */
/* Create ping string */
(void) strncpy(ping, &read_line[start], size_ping);
ping[size_ping]='\n';
ping[size_ping+1]='\0';
/* Free memory */
free(read_line);
read_line = NULL;
n = 0;
break;
}
free(read_line);
read_line = NULL;
n = 0;
//}
/* free allocated memory */
regfree(p_reg);
free(p_reg);
free(pmatch);
(void) fclose(fd);
/* ping may be null, then it must mean that the ping request was lost */
return ping;
}
/*
-- write_ping_log --
Desc :
Function which write a given ping in log file
In-param :
new_ping : string value of a ping
Out-param :
None
Return value :
None
*/
void write_ping_log(char* new_ping){
/* Variables */
FILE* fd;
/* Open log file */
fd = fopen("/var/log/ping-report/all-ping.log","a+");
if(fd != NULL){
if(new_ping == NULL){
new_ping = (char *) malloc(5*sizeof(char));
if(new_ping == NULL){
(void) fclose(fd);
return;
}
(void) snprintf(new_ping,5*sizeof(char),"LOSS");
}
(void) fwrite(new_ping, sizeof(char), strlen(new_ping), fd);
(void) fclose(fd);
}else{
perror("write ping : ");
}
free(new_ping);
}
/*
-- set_stats_ping --
Desc :
Function which calculate statistics about ping values, from log file.
In-param :
None
Out-param :
None
Return value :
None
*/
void set_stats_ping(){
/* Variables */
FILE* fd;
/* Open log file */
fd = fopen("/var/log/ping-report/all-ping.log","r");
if(fd != NULL){
/* Stats variables */
double ping = 0.0;
double sum = 0.0;
double max = 0.0;
double min = 100.0;
double mean = 0.0;
int nb_high = 0;
int nb_loss = 0;
int nb_ping = 0;
char* read_line = NULL;
size_t n = 0;
/* Read file */
while(getline(&read_line,&n,fd) != -1){
/* Check getline error */
if(read_line == NULL){
break;
}
/* Check if the ping is flagged as LOSS */
if(strcmp(read_line,"LOSS") == 0){
nb_loss++;
}else{
/* Evaluate the ping as a double */
ping = strtod(read_line,NULL);
/* Test null ping */
if(ping < 0.1){
/* Ignore null ping */
}else{
/* Number of ping readed (for mean calculation) */
nb_ping++;
/* Max ping */
if(ping > max){
max = ping;
}
/* Min ping */
if(ping < min){
min = ping;
}
/* Number of ping above 100 ms */
if(ping > 100.0){
nb_high++;
}
/* Sum (for mean calculation) */
sum += ping;
}
}
free(read_line);
n = 0;
}
/* Mean calculation */
mean = sum / (double) nb_ping;
(void) fclose(fd);
insert_hourly_report(mean,max,min,nb_high,nb_loss,nb_ping);
if(read_line != NULL){
free(read_line);
}
}else{
perror("stats : ");
}
}