<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kastuvpokharel on Medium]]></title>
        <description><![CDATA[Stories by Kastuvpokharel on Medium]]></description>
        <link>https://medium.com/@kastuvpokharel?source=rss-1a3b9af6c20e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4UXqNENuCa97wo2z</url>
            <title>Stories by Kastuvpokharel on Medium</title>
            <link>https://medium.com/@kastuvpokharel?source=rss-1a3b9af6c20e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 03:01:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kastuvpokharel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Every important way to use const in C++, what it really means, why it exists, how to read it, and…]]></title>
            <link>https://medium.com/@kastuvpokharel/every-important-way-to-use-const-in-c-what-it-really-means-why-it-exists-how-to-read-it-and-eeffdeef0613?source=rss-1a3b9af6c20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeffdeef0613</guid>
            <category><![CDATA[cplusplus]]></category>
            <category><![CDATA[const]]></category>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[Kastuvpokharel]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 03:41:33 GMT</pubDate>
            <atom:updated>2026-01-06T03:41:33.543Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Every important way to use </strong><strong>const in C++</strong>, what it <em>really</em> means, <strong>why it exists</strong>, how to read it, and <strong>exactly when to use/not use</strong> it; with examples.</h3><h3>The one mental model that prevents confusion</h3><p>const is a <strong>promise</strong>:</p><blockquote><em>“Through </em>this name / this view<em>, you will not modify that object.”</em></blockquote><p>It does <strong>NOT</strong> always mean “the object can never change in the whole program”.</p><p>Example:</p><pre>int x = 10;</pre><pre>const int&amp; a = x;   // through &#39;a&#39;, you can&#39;t change x<br>int&amp;       b = x;   // through &#39;b&#39;, you can change x</pre><pre>// a = 20;          // ERROR<br>b = 20;             // OK, and x is now 20</pre><p>So const is about <strong>permissions through a specific handle</strong> (variable/reference/pointer/this), not always global immutability.</p><h3>How to read const (the no-confusion rule)</h3><h3>Rule A (super reliable):</h3><ul><li>const <strong>before</strong> * → the <strong>pointed value</strong> is const</li><li>const <strong>after</strong> * → the <strong>pointer itself</strong> is const</li><li>trailing const after a member function → the function <strong>won’t modify the object</strong></li></ul><h3>Rule B (quick scan):</h3><ul><li>If you can move const left/right without changing meaning (T const == const T), it’s the <strong>same</strong>.</li></ul><h3>1) const on normal variables</h3><pre>const int a = 5;<br>// a = 6; // ERROR</pre><h3>Why use it?</h3><ul><li>expresses “this should not change”</li><li>prevents accidental changes</li><li>documents intent</li></ul><h3>Important truth:</h3><p>const int a = 5; is <strong>not always compile-time</strong>. (It <em>can be</em>, but not guaranteed in every context.)</p><p>If you need compile-time constant, prefer <strong>constexpr</strong>:</p><pre>constexpr int N = 64;   // guaranteed compile-time</pre><h3>When not to use const for locals?</h3><p>If the variable is obviously temporary and short-lived, const can add noise. But it’s not “wrong”.</p><h3>2) const with references (most common clean API)</h3><h3>Const reference: read-only view</h3><pre>void printSize(const std::string&amp; s) {<br>  // s.push_back(&#39;!&#39;); // ERROR<br>  std::cout &lt;&lt; s.size();<br>}</pre><p><strong>Why:</strong> avoids copying big objects, and guarantees “I won’t modify your input”.</p><h3>Non-const reference: means “I will/might modify”</h3><pre>void makeUpper(std::string&amp; s) {   // output / modify parameter<br>  for (char&amp; c : s) c = std::toupper((unsigned char)c);<br>}</pre><h3>Rule for parameters:</h3><ul><li><strong>Input only</strong>: const T&amp;</li><li><strong>Output / in-out</strong>: T&amp;</li><li><strong>Small cheap types</strong> (int, double, pointers): pass by value</li></ul><h3>3) const with pointers (where most confusion happens)</h3><p>Let:</p><pre>int x = 10;<br>int y = 20;</pre><h3>A) Pointer to const (cannot modify the pointee)</h3><pre>const int* p = &amp;x;   // same as: int const* p</pre><pre>// *p = 5;           // ERROR (value is const through p)<br>p = &amp;y;              // OK (pointer can move)</pre><p><strong>Meaning:</strong> “I can point to different ints, but I won’t modify them through this pointer.”</p><h3>B) Const pointer (pointer itself cannot change)</h3><pre>int* const p = &amp;x;</pre><pre>*p = 5;              // OK (value modifiable)<br>p = &amp;y;              // ERROR (pointer is const)</pre><p><strong>Meaning:</strong> “This pointer always points to the same place.”</p><h3>C) Const pointer to const (neither changes)</h3><pre>const int* const p = &amp;x;</pre><pre>// *p = 5;           // ERROR<br>// p = &amp;y;           // ERROR</pre><h3>Multi-level pointers (important in real code)</h3><pre>int x = 1, y = 2;</pre><pre>const int* p1 = &amp;x;         // read-only int<br>const int** pp = &amp;p1;       // pointer to pointer-to-const-int</pre><p>This gets tricky fast. Use the same rule:</p><ul><li>const next to a type affects <strong>that level</strong>.</li></ul><p>Example:</p><pre>int* p = &amp;x;</pre><pre>int* const* a = &amp;p;   // a points to a const pointer-to-int<br>// (*a) = &amp;y;         // ERROR (the pointer stored is const through &#39;a&#39;)<br>// **a = 7;           // OK (int is modifiable)</pre><p><strong>Pro tip:</strong> if pointer constness goes beyond 1 level, consider using references, spans, or smart pointers instead.</p><h3>4) const in function parameters</h3><h3>Pass-by-value: top-level const is pointless</h3><pre>void f(const int x) {  // same as: void f(int x)<br>  // x is a copy anyway<br>}</pre><p><strong>Why pointless:</strong> callers don’t benefit; you only make the local copy non-modifiable.</p><h3>Pass-by-reference/pointer: const matters</h3><pre>void f(const int&amp; x) { }     // cannot modify caller’s int<br>void g(const int* p) { }     // cannot modify *p</pre><h3>5) const in return types (very misunderstood)</h3><h3>Returning by value: const is basically useless</h3><pre>const int get() { return 5; } // useless const (caller gets a copy)</pre><p>It doesn’t protect anything meaningful.</p><h3>Returning by reference/pointer: const matters a lot</h3><pre>struct A {<br>  int value = 0;</pre><pre>  const int&amp; getValue() const { return value; } // caller can&#39;t modify value through this ref<br>  int&amp;       getValue()       { return value; } // non-const version allows modification<br>};</pre><p><strong>This is how you build correct APIs</strong>.</p><h3>6) const member functions (the trailing const)</h3><pre>struct Vec {<br>  int x = 0;<br>  int y = 0;</pre><pre>  int sum() const {        // trailing const<br>    return x + y;          // OK<br>    // x = 5;              // ERROR<br>  }</pre><pre>  void setX(int v) { x = v; } // non-const: allowed to modify<br>};</pre><h3>What it really means</h3><p>A const member function treats this as:</p><pre>Vec const* this;</pre><p>So you can’t modify the object’s non-mutable fields.</p><h3>Why it exists</h3><p>So <strong>const objects</strong> can still call “read-only” methods:</p><pre>const Vec v{1,2};<br>v.sum();    // OK<br>// v.setX(3); // ERROR</pre><h3>Const + overload pattern (very common)</h3><pre>struct Buffer {<br>  std::vector&lt;int&gt; data;</pre><pre>  int&amp; operator[](size_t i) { return data[i]; }              // modifiable<br>  const int&amp; operator[](size_t i) const { return data[i]; }  // read-only<br>};</pre><p>This is the “const-correct interface”.</p><h3>7) mutable (the “exception tool”)</h3><p>Sometimes you want a logically-const method that still updates <em>internal bookkeeping</em> (like caching).</p><pre>struct Foo {<br>  int value = 0;<br>  mutable bool cached = false;<br>  mutable int cache = 0;</pre><pre>  int expensive() const {<br>    if (!cached) {<br>      cache = value * 100;  // allowed because cache is mutable<br>      cached = true;<br>    }<br>    return cache;<br>  }<br>};</pre><h3>When mutable is appropriate</h3><ul><li>caching</li><li>lazy computation</li><li>statistics counters</li><li>debug tracking</li></ul><h3>When it’s a bad sign</h3><p>If you use mutable to bypass const and actually change “real state”, you’re lying to users.</p><h3>8) const data members (inside classes)</h3><pre>struct User {<br>  const int id;<br>  std::string name;</pre><pre>  User(int id_, std::string name_)<br>    : id(id_), name(std::move(name_)) {}  // MUST initialize in init-list<br>};</pre><h3>Key rule</h3><p>const data members <strong>must</strong> be initialized in the constructor initializer list, not assigned later.</p><h3>When to use</h3><ul><li>true identity/invariant fields (IDs, fixed configuration)</li></ul><h3>When not to use</h3><p>If the object needs to be assignable or movable easily, too many const members can make assignment operators awkward.</p><h3>9) const objects vs “const view”</h3><h3>A) const object</h3><pre>const std::string s = &quot;hi&quot;;<br>// s += &quot;!&quot;; // ERROR</pre><h3>B) non-const object, const view</h3><pre>std::string s = &quot;hi&quot;;<br>const std::string&amp; view = s;<br>// view += &quot;!&quot;; // ERROR<br>s += &quot;!&quot;;       // OK</pre><h3>10) const and auto / type deduction (big gotcha area)</h3><h3>auto drops top-level const</h3><pre>const int a = 5;<br>auto b = a;        // b is int (const dropped)<br>b = 10;            // OK</pre><h3>auto&amp; keeps it</h3><pre>const int a = 5;<br>auto&amp; r = a;       // r is const int&amp;</pre><h3>Want to keep const explicitly?</h3><pre>const auto c = a;  // c is const int</pre><h3>Templates behave similarly</h3><pre>template &lt;typename T&gt;<br>void foo(T x);     // T deduces WITHOUT top-level const for pass-by-value</pre><pre>template &lt;typename T&gt;<br>void bar(const T&amp; x); // const is enforced on the reference view</pre><h3>11) const with STL containers (what changes when container is const)</h3><pre>std::vector&lt;int&gt; v = {1,2,3};<br>const std::vector&lt;int&gt;&amp; cv = v;</pre><pre>// cv[0] = 9; // ERROR (operator[] const returns const int&amp;)</pre><p>Also:</p><ul><li>cv.begin() gives const_iterator</li><li>cv cannot call non-const functions like push_back</li></ul><h3>Important: vector&lt;const T&gt; is basically not allowed</h3><p>Because elements must be assignable; const T breaks that requirement.</p><p>Use:</p><ul><li>vector&lt;T&gt; and give out const T&amp; views, or</li><li>vector&lt;std::unique_ptr&lt;const T&gt;&gt; if you truly need immutable pointees.</li></ul><h3>12) const and smart pointers (very common in real code)</h3><h3>std::shared_ptr&lt;const T&gt;</h3><p>The <strong>object</strong> is const through the pointer:</p><pre>std::shared_ptr&lt;const Widget&gt; p = ...;<br>// p-&gt;mutate(); // ERROR if mutate isn&#39;t const</pre><h3>const std::shared_ptr&lt;T&gt;</h3><p>The <strong>smart pointer handle</strong> is const (can’t reseat), but object can still be modified:</p><pre>const std::shared_ptr&lt;Widget&gt; p = ...;<br>p-&gt;mutate();    // OK<br>// p = other;   // ERROR (handle is const)</pre><p>These two are completely different.</p><h3>13) const_cast (the “danger tool”)</h3><p>You can remove constness <strong>only safely</strong> if the original object was not actually const.</p><pre>void takesNonConst(int&amp; x) { x = 99; }</pre><pre>void caller(const int&amp; a) {<br>  // takesNonConst(a); // ERROR<br>  takesNonConst(const_cast&lt;int&amp;&gt;(a)); // compiles, but DANGEROUS<br>}</pre><h3>Safe case</h3><pre>int x = 5;<br>const int&amp; a = x;                      // original is non-const<br>int&amp; b = const_cast&lt;int&amp;&gt;(a);          // OK<br>b = 7;                                 // OK, modifies x</pre><h3>Undefined behavior case (must never do)</h3><pre>const int x = 5;<br>int&amp; y = const_cast&lt;int&amp;&gt;(x);<br>y = 7;   // UNDEFINED BEHAVIOR</pre><p><strong>Rule:</strong> If the original object was declared const, modifying it after cast is UB.</p><h3>14) const in lambdas (surprising but important)</h3><p>By default, a lambda’s call operator is const.</p><pre>int x = 0;<br>auto f = [x]() { <br>  // x++; // ERROR (captured by value, and operator() is const)<br>};</pre><p>Use mutable lambda if you want to modify captured-by-value copies:</p><pre>auto g = [x]() mutable {<br>  x++;    // OK (modifies lambda&#39;s internal copy)<br>};</pre><h3>15) const with function pointers / member pointers (completeness)</h3><p>Pointer to const member function vs non-const:</p><pre>struct A {<br>  void f() {}<br>  void g() const {}<br>};</pre><pre>void (A::*p1)() = &amp;A::f;          // non-const member function pointer<br>void (A::*p2)() const = &amp;A::g;    // const member function pointer</pre><p>This matters when you call through them.</p><h3>16) const with volatile (rare but real)</h3><p>volatile means “don’t optimize away reads/writes; value may change unexpectedly” (hardware registers, signal handlers).</p><pre>volatile int* reg = ...;          // hardware register<br>const volatile int* status = ...; // read-only status register</pre><p>Usually embedded/low-level only.</p><h3>When you STRICTLY should use const</h3><h3>1) Function inputs that you don’t intend to modify</h3><pre>void log(const std::string&amp; msg);</pre><h3>2) Member functions that are logically read-only</h3><pre>int size() const;<br>bool empty() const;</pre><h3>3) Return references/pointers when caller must not modify internals</h3><pre>const std::vector&lt;int&gt;&amp; data() const;</pre><h3>4) To enforce invariants (IDs/config that must not change)</h3><pre>const int id;</pre><h3>When you STRICTLY should NOT use const (common traps)</h3><h3>1) const on return-by-value</h3><pre>const int f();        // pointless<br>const std::string g();// pointless</pre><h3>2) const on pass-by-value parameters (usually)</h3><pre>void f(const int x);  // caller gains nothing</pre><p>It can be okay if you personally want “don’t modify local copy”, but it’s not an API feature.</p><h3>3) Over-consting locals in a way that reduces clarity</h3><p>If everything is const, it becomes visual noise. Use it where it signals something important.</p><h3>The “How do I decide?” checklist (zero confusion)</h3><h3>For parameters</h3><ul><li>Small primitive? → T (by value)</li><li>Big object input-only? → const T&amp;</li><li>You need to modify caller’s object? → T&amp;</li><li>Optional / nullable? → const T* (input) or T* (output/in-out)</li></ul><h3>For member functions</h3><p>Ask: “If I call this on a const object, should it work?”</p><ul><li>Yes → make it const</li><li>No → non-const<br>If you need caching → use mutable for cache fields only.</li></ul><h3>For pointers</h3><p>Decide two separate things:</p><ol><li>Can I modify the pointed-to value?</li><li>Can I reseat the pointer?</li></ol><p>Then pick:</p><ul><li>const T* (no modify value, can reseat)</li><li>T* const (can modify value, cannot reseat)</li><li>const T* const (neither)</li></ul><h3>Mini cheat sheet (memorize this)</h3><pre>const T* p;      // can&#39;t modify *p<br>T* const p;      // can&#39;t change p<br>const T* const p;// can&#39;t change either</pre><pre>T&amp; r;            // modify original<br>const T&amp; r;      // read-only view</pre><pre>int f() const;   // member function: can&#39;t modify *this<br>mutable int x;   // allowed to change even in const functions</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeffdeef0613" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QNetworkInformation (C++) vs NetworkInformation (QML): performance, efficiency, security and what…]]></title>
            <link>https://medium.com/@kastuvpokharel/qnetworkinformation-c-vs-networkinformation-qml-performance-efficiency-security-and-what-cf2d6382d147?source=rss-1a3b9af6c20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf2d6382d147</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[network-information-api]]></category>
            <category><![CDATA[qml]]></category>
            <category><![CDATA[qnetworkinformation]]></category>
            <category><![CDATA[qt]]></category>
            <dc:creator><![CDATA[Kastuvpokharel]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 17:57:03 GMT</pubDate>
            <atom:updated>2025-12-15T18:01:40.362Z</atom:updated>
            <content:encoded><![CDATA[<h3>QNetworkInformation (C++) vs NetworkInformation (QML): performance, efficiency, security and what to choose</h3><p>If you want to know what QNetworkInformation is read this short article first, as this will be the perquisite for this article; <a href="https://medium.com/@kastuvpokharel/qnetworkinformation-and-what-it-is-exactly-aa6bb198d290">https://medium.com/@kastuvpokharel/qnetworkinformation-and-what-it-is-exactly-aa6bb198d290</a></p><p><em>Note: Also open and read every links used here from Qt documentation to better understand the fundamentals- of what is written here in simplified version.</em></p><p>In Qt, <strong>QNetworkInformation (C++)</strong> and <strong>NetworkInformation (QML)</strong> are two faces of the same idea: <em>read OS/plugin-reported network state (reachability, transport, metered, captive portal) and react to changes</em>. The main difference isn’t raw speed, it’s <strong>where you place the “decision-making” in your architecture</strong>.</p><h4>What each one is</h4><ul><li><strong>C++ </strong><strong>QNetworkInformation</strong>: a <strong>singleton</strong> that you typically <strong>load a backend for</strong>, and then read values/signals from. It stays alive after loading until app shutdown. [<a href="https://doc.qt.io/qt-6/qnetworkinformation.html">https://doc.qt.io/qt-6/qnetworkinformation.html</a>]</li><li><strong>QML </strong><strong>NetworkInformation</strong>: a <strong>singleton QML type</strong> (import QtNetwork) that exposes similar read-only properties (reachability, transportMedium, isMetered, isBehindCaptivePortal) and explicitly maps to the C++ class (“In C++: QNetworkInformation”). Also note it’s <strong>Since: Qt 6.7</strong>. [<a href="https://doc.qt.io/qt-6/qml-qtnetwork-networkinformation.html">https://doc.qt.io/qt-6/qml-qtnetwork-networkinformation.html</a>]</li></ul><h3>Performance &amp; efficiency</h3><p><strong>In normal apps, the performance difference is negligible.</strong> Both approaches ultimately depend on the same platform/backend reporting. The cost is not in “checking” but in how you <em>use</em> the state:</p><ul><li><strong>QML bindings are reactive, not polling.</strong> A binding is re-evaluated when its dependencies change; the engine tracks dependencies and updates automatically. That means using NetworkInformation in UI bindings usually doesn’t add meaningful overhead. [<a href="https://doc.qt.io/qt-6/qtqml-syntax-propertybinding.html?utm_source=chatgpt.com">https://doc.qt.io/qt-6/qtqml-syntax-propertybinding.html</a>]</li><li><strong>Where perf can suffer:</strong> if you scatter network-policy logic across many QML files (lots of duplicated JS checks, repeated state handling), maintenance and accidental churn increases. Qt’s own guidance is: <strong>QML for UI, C++ for business logic</strong> (and for things that are “faster in C++ than QML” like processing). [<a href="https://doc.qt.io/qt-6/qtquick-bestpractices.html">https://doc.qt.io/qt-6/qtquick-bestpractices.html</a>]</li></ul><p><strong>Bottom line:</strong> UI reactions in QML are efficient; <em>policy + workflow</em> is usually cleaner and safer in C++.</p><h3>Correctness &amp; “security”</h3><p>Here’s the big pitfall: <strong>reachability is not a guarantee of real connectivity</strong>.</p><p>Qt explicitly warns that reachability() is based on OS/plugin reports and “may not always be accurate,” and <strong>should not be used as a definitive pre-check before attempting a network connection</strong>. [<a href="https://doc.qt.io/qt-6/qnetworkinformation.html#:~:text=However%2C%20this%20information,of%20connectivity%20state">https://doc.qt.io/qt-6/qnetworkinformation.html#:~:text=However%2C%20this%20information,of%20connectivity%20state</a>.]<br> So whichever layer you choose, you still must handle real failures in your actual network operations (timeouts, auth errors, captive portal quirks, DNS issues).</p><p>On “security”: this usually means <strong>keeping important decisions out of the UI layer</strong>.</p><ul><li>If “internet status” influences <strong>data integrity</strong> (auto-push edits, queue flushing, retry rules, metered-data restrictions), treat that as <strong>business logic</strong> → put it in C++ (more testable, centralized, less fragile). Qt’s best-practices page explicitly recommends <strong>separating UI (QML) from business logic (C++)</strong> for maintainability and performance reasons. [<a href="https://doc.qt.io/qt-6/qtquick-bestpractices.html#:~:text=Separate%20UI%20from%20Business,models%20written%20in%20QML%3A">https://doc.qt.io/qt-6/qtquick-bestpractices.html#:~:text=Separate%20UI%20from%20Business,models%20written%20in%20QML%3A</a>]</li></ul><h3>Prefer C++ (QNetworkInformation) when you’re doing:</h3><ul><li>Auto-sync / “push when online”</li><li>Queueing, retry/backoff, scheduling</li><li>Metered-data policy enforcement</li><li>Anything that must behave consistently even if UI changes</li></ul><p>Qt’s guidance: <strong>C++ is best suited for business logic</strong>; QML is best suited for UI.</p><h3>Prefer QML (NetworkInformation) when you’re doing:</h3><ul><li>Showing “Offline” / “Metered” banners</li><li>Disabling/enabling UI buttons (“Sync now”)</li><li>Displaying transport (“Wi-Fi / Cellular”) or captive portal hints</li></ul><p>And you want it to update naturally via bindings (reactive updates).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf2d6382d147" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QNETWORKINFORMATION and what it is exactly.]]></title>
            <link>https://medium.com/@kastuvpokharel/qnetworkinformation-and-what-it-is-exactly-aa6bb198d290?source=rss-1a3b9af6c20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa6bb198d290</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[qt-internet-connection]]></category>
            <category><![CDATA[qt]]></category>
            <category><![CDATA[qnetwork]]></category>
            <category><![CDATA[qnetworkinformation]]></category>
            <dc:creator><![CDATA[Kastuvpokharel]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 20:53:12 GMT</pubDate>
            <atom:updated>2025-12-11T01:15:59.821Z</atom:updated>
            <content:encoded><![CDATA[<p>QNetworkInformation is a Qt6 class that lets your app ask <strong>“what is the state of this device’s network <em>right now</em>?”</strong> in a clean, cross-platform way.</p><p>I recommend reading qt docs on QtNetworkInformation to understand the members of this class, available signals and other handlers.<br><a href="https://doc.qt.io/qt-6/qnetworkinformation.html">https://doc.qt.io/qt-6/qnetworkinformation.html</a></p><p>Let’s break it down in simple way to understand the core usage:</p><h3>1. What is QNetworkInformation?</h3><p>It’s a <strong>singleton-style API in QtNetwork</strong> that gives you <strong>high-level information about the device’s connectivity</strong>:</p><ul><li>Is there <em>any</em> network at all?</li><li>Is the network <strong>reachable</strong> (i.e., could I use it, in theory)?</li><li>Is it <strong>behind a captive portal</strong> (hotel Wi-Fi login page)?</li><li>Is the network <strong>metered</strong> (mobile data, expensive hotspot)?</li><li>What <strong>transport type</strong> am I using (Wi-Fi, cellular, Ethernet, etc.)?</li></ul><p>In code form, it’s basically:</p><pre>#include &lt;QNetworkInformation&gt;</pre><pre>auto *info = QNetworkInformation::instance();<br>if (!info)<br>    return; // No backend/plugin available</pre><pre>if (info-&gt;reachability() == QNetworkInformation::Reachability::Online) {<br>    qDebug() &lt;&lt; &quot;We have some kind of network!&quot;;<br>}</pre><p>So instead of you manually poking OS APIs on macOS, Windows, Android, Linux, etc., Qt gives you one abstraction.</p><h3>2. Why does it exist? (vs the old stuff)</h3><p>Before QNetworkInformation, we had older APIs like:</p><ul><li>QNetworkConfigurationManager</li><li>QNetworkSession</li></ul><p>These were:</p><ul><li>Kind of <strong>clunky and over-abstracted</strong>.</li><li>Inconsistent across platforms.</li><li>Not great at modern concepts like <strong>metered networks</strong> or <strong>captive portals</strong>.</li></ul><p>Modern apps need higher-level semantic questions like:</p><ul><li>“Should I auto-download a 2 GB update right now?”</li><li>“Is this connection probably expensive?”</li><li>“Am I actually online, or stuck at a coffee shop login page?”</li></ul><p>QNetworkInformation exists to give those <strong>semantic answers</strong> while Qt handles the platform differences.</p><h3>3. What exactly does it tell you?</h3><p>Key pieces you can query:</p><h3>a) Reachability</h3><pre>QNetworkInformation::Reachability r = info-&gt;reachability();</pre><p>Typical values (names may differ slightly by Qt version):</p><ul><li>Unknown – we don’t know yet.</li><li>Disconnected – no usable network.</li><li>Local – only local network (e.g. LAN, no internet).</li><li>Online – you likely have internet.</li></ul><p>You use this to decide:<br> <strong>Do I show “offline mode” / retry UI / disable network-heavy buttons?</strong></p><h3>b) Transport Medium</h3><pre>QNetworkInformation::TransportMedium medium = info-&gt;transportMedium();</pre><p>Examples:</p><ul><li>Unknown</li><li>Ethernet</li><li>Wifi</li><li>Cellular</li><li>Bluetooth</li><li>Other</li></ul><p>Why it matters:</p><ul><li>If <strong>Cellular</strong> → avoid big downloads, reduce quality (e.g. 480p video).</li><li>If <strong>Wifi/Ethernet</strong> → you can be more aggressive with sync, prefetch, updates.</li></ul><h3>c) Metered vs Unmetered</h3><pre>bool metered = info-&gt;isMetered();</pre><ul><li>true → The OS thinks this connection is <strong>expensive</strong> (mobile data, tethering, etc.).</li><li>false → Likely safe to use more bandwidth.</li></ul><p>This is how you implement <strong>“Respect data saver”</strong> style behavior:</p><ul><li>No auto-download of HD images.</li><li>Ask user before updating big files.</li><li>Lower polling frequency.</li></ul><h3>d) Captive Portal</h3><pre>bool captive = info-&gt;isBehindCaptivePortal();</pre><p>Behind a captive portal =<br> You’re “connected” to Wi-Fi but all HTTP/S requests are redirected to a login page (e.g., airports, hotels).</p><p>Realistically:</p><ul><li>You don’t want to show “You are offline”.</li><li>But also <strong>your app can’t really reach its servers</strong>.</li><li>You might show: “You appear to be on a network that requires sign-in.”</li></ul><h3>e) Change notifications (signals)</h3><p>You don’t just query once; you can <strong>react to changes</strong>:</p><pre>QObject::connect(info, &amp;QNetworkInformation::reachabilityChanged,<br>                 [](QNetworkInformation::Reachability r) {<br>    qDebug() &lt;&lt; &quot;Reachability changed to&quot; &lt;&lt; r;<br>});</pre><pre>QObject::connect(info, &amp;QNetworkInformation::isMeteredChanged,<br>                 [](bool metered) {<br>    qDebug() &lt;&lt; &quot;Metered changed:&quot; &lt;&lt; metered;<br>});</pre><p>So when the user:</p><ul><li>Turns off Wi-Fi,</li><li>Switches to LTE,</li><li>Enters or leaves a captive portal,</li></ul><p>your app can immediately adapt.</p><h3>4. How it works under the hood (plugins)</h3><p>QNetworkInformation itself is <strong>just an abstraction</strong>. The real work is done by <strong>platform-specific backends/plugins</strong>.</p><p>Depending on Qt version and platform, there might be backends like:</p><ul><li>Darwin (macOS/iOS)</li><li>Android</li><li>Win32</li><li>NetworkManager (Linux)</li><li>Falling back to a “basic” or “no-op” backend if nothing better is available.</li></ul><p>Qt chooses a backend automatically, but you can inspect:</p><pre>qDebug() &lt;&lt; QNetworkInformation::availableBackends();<br>// and<br>qDebug() &lt;&lt; QNetworkInformation::loadBackendByName(&quot;backend_name&quot;);</pre><p>In practice you rarely need to override it, but this explains <strong>why </strong><strong>instance() can be null</strong> if no usable backend is available.</p><h3>5. Simple example in a real app</h3><p>Imagine you’re building a Qt app that syncs data to the cloud.</p><p>You might:</p><pre>auto *info = QNetworkInformation::instance();<br>if (!info) {<br>    // Backend not available, either just try to connect<br>    // or assume worst case and be conservative<br>    return;<br>}</pre><pre>bool online = info-&gt;reachability() == QNetworkInformation::Reachability::Online;<br>bool metered = info-&gt;isMetered();</pre><pre>if (!online) {<br>    showOfflineBanner();<br>} else if (metered) {<br>    showMessage(&quot;You&#39;re on a metered connection. Syncing smaller items only.&quot;);<br>    startLightweightSync();<br>} else {<br>    startFullSync();<br>}</pre><p>And you connect to reachabilityChanged + isMeteredChanged to re-trigger this decision whenever something changes.</p><h3>6. How this is different from “just pinging a server”</h3><p>You <em>could</em> do:</p><ul><li>Send an HTTP GET to <a href="https://example.com/ping">https://example.com/ping</a></li><li>If it works: “I’m online”.</li></ul><p>But:</p><ul><li>This doesn’t tell you if the network is <strong>metered</strong>.</li><li>It doesn’t know if the OS thinks you’re under a <strong>data saver</strong> mode.</li><li>It might temporarily fail due to DNS but the network is actually fine.</li><li>On captive portals, it might succeed but redirect to a login page.</li></ul><p>QNetworkInformation asks the <strong>OS</strong> instead, which is usually smarter:</p><ul><li>It can know if you’re on LTE vs Wi-Fi.</li><li>It may know user preferences (e.g. “Don’t use background data on mobile”).</li><li>It integrates better with system network monitoring.</li></ul><p>So: QNetworkInformation is about <strong>policy &amp; semantics</strong>, not just “can I open a socket”.</p><h3>7. Where it fits in Qt overall</h3><p>Think of the layers:</p><ul><li><strong>QNetworkInformation</strong> → <em>“Should I even try? And how?”</em></li><li><strong>QNetworkAccessManager / QNetworkReply</strong> → actual HTTP/HTTPS requests.</li><li><strong>QTcpSocket, QUdpSocket, QSslSocket</strong> → low-level socket APIs.</li></ul><p>You use QNetworkInformation to <strong>decide behavior</strong> before using these lower-level APIs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa6bb198d290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network interface En0, En1, .. , En8]]></title>
            <link>https://medium.com/@kastuvpokharel/network-interface-en0-en1-en8-7c11aa878eda?source=rss-1a3b9af6c20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c11aa878eda</guid>
            <category><![CDATA[sniffer]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[packets-analyzing]]></category>
            <category><![CDATA[sniffing]]></category>
            <dc:creator><![CDATA[Kastuvpokharel]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 14:29:19 GMT</pubDate>
            <atom:updated>2025-07-06T14:30:20.591Z</atom:updated>
            <content:encoded><![CDATA[<h3>Network interface En0, En1, .. , En8</h3><h3>What is it?</h3><p>When you’re using a Mac, you have Ethernet or Wi-Fi adapters that help you connect to the internet. The primary interface is usually <strong>en0</strong>, which is typically your Wi-Fi on a MacBook. Other interfaces like <strong>en1</strong>, <strong>en2</strong>, and so on, usually represent:</p><ul><li>Secondary ports</li><li>Virtual interfaces created by tools like Docker, virtual machines (VMs), or Thunderbolt Ethernet.</li></ul><h3>What does it do?</h3><p>These interfaces are crucial because they send and receive all your internet traffic. This includes everything from browsing the web to streaming SSH sessions and more.</p><h3>Usage in Packet Sniffing:</h3><p>If you’re interested in capturing live external traffic, these interfaces are your best bet! They can capture various types of data, including Layer 2 frames, IP packets, TCP, UDP, and more.</p><p><strong>Example:</strong></p><p>If you’re browsing on <strong>en0</strong> (Wi-Fi), capturing on <strong>en0</strong> will give you access to:</p><ul><li>DNS requests</li><li>HTTP/HTTPS requests</li><li>All TCP/UDP traffic</li><li>ARP, DHCP broadcasts, and more.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1y-sulVRsefG5AfQXQ2lg.png" /></figure><p>This setup is ideal for full-packet capture. If you’re using Linux or macOS, you can enter monitor mode for raw Wi-Fi frames (just keep in mind it requires special setup).</p><h3>Can Inject? Yes (with Caveats)</h3><p><strong>Ethernet (Wired):</strong> You can fully inject L2 (MAC), L3 (IP), and L4 (TCP/UDP) using pcap_sendpacket() or even raw sockets with BPF.</p><p><strong>Wi-Fi (macOS):</strong> Injection is tricky unless you’re in monitor mode, and even then, it has limitations. Many MacBooks block monitor mode injection due to Apple drivers.</p><p>For instance, you can spoof DNS responses on <strong>en0</strong> using raw UDP packets.</p><h3>Attack Surface:</h3><p>These interfaces have a <strong>High</strong> attack surface as they are your computer’s gateway to the network. Common attacks include:</p><ul><li>Man-in-the-middle attacks (like ARP spoofing)</li><li>DNS poisoning</li><li>Rogue DHCP servers</li><li>TCP RST/FIN injection</li><li>MAC flooding</li></ul><h3>Passive Visibility:</h3><ul><li><strong>Very High</strong> — All real traffic flows through these interfaces.</li><li>Promiscuous mode can sniff other LAN clients (if not switched).</li></ul><h3>Defensive Use:</h3><p>These interfaces are perfect for intrusion detection.</p><h3>Isolation Risk:</h3><p>Be cautious! A misconfigured bridge (like <strong>en3</strong> in a VM) can expose your host to guest traffic. VPN leaks can also happen if the firewall doesn’t isolate <strong>enX</strong>.</p><h3>Abuse Potential:</h3><p>Malware can exfiltrate or inject data (e.g., via TCP port 80). Plus, Wi-Fi drivers (like Broadcom) have had buffer overflow CVEs in the past.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c11aa878eda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Structure Projects in C++ or Qt: CMake and Directories]]></title>
            <link>https://medium.com/@kastuvpokharel/how-to-structure-projects-in-c-or-qt-cmake-and-directories-c03012e521bd?source=rss-1a3b9af6c20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c03012e521bd</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[cpp-programming]]></category>
            <category><![CDATA[cmake]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[qt]]></category>
            <dc:creator><![CDATA[Kastuvpokharel]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 21:40:29 GMT</pubDate>
            <atom:updated>2025-06-20T20:58:38.198Z</atom:updated>
            <content:encoded><![CDATA[<p>YouTube tutorial:<br><a href="https://youtu.be/sJu8qb37Jaw?si=pwQv-0FUAa9RPlml"> https://youtube.com/playlist?list=PLeYV3WjZWmHzBttvbFuUhAFhrU5Q4Z3Y7</a></p><p>Let’s start with CMake.<br>Qt6 projects are built with CMake, and CMake plays a crucial role in managing and structuring C++ projects.</p><h3>What is CMake?</h3><p>CMake is a build system manager — it tells tools like Make, Ninja, or Visual Studio how to compile our C++ code, what libraries to use, where to find headers, or how to organize the output.</p><p>Note: CMake is not a compiler. It is just a build system generator. It creates the actual build files (like Makefile, Ninja files, Visual Studio solutions) that tell the compiler like g++, clang++, etc., how to build our C++ project.</p><p>One important term that keeps coming up when working with CMake is “target”.</p><h3>What is a target?</h3><p>A target is the thing you’re building.</p><p><strong>What it Builds:</strong></p><p>add_executable(): A complete program with main()<br>add_library(): A reusable module (static/shared)<br>Imported target: From system or library (like Qt6::Core)</p><p><strong>Example:</strong></p><pre>add_executable(MyApp main.cpp)</pre><p><strong>Here:</strong></p><p>MyApp is a target name.<br>It’s an executable target.<br>It will build into something like MyApp.exe or ./MyApp.</p><h3>Why Targets Have Different Names in Folders?</h3><p>Because each folder has its own role, so its target is named after what it’s doing.</p><p><strong>Example:</strong></p><pre>project/<br>├── src/<br>│   ├── Core/<br>│   ├── UI/<br>│   └── Network/</pre><p><strong>Each has:</strong></p><pre># src/Core/CMakeLists.txt<br>add_library(CoreLib STATIC CoreEngine.cpp)</pre><pre># src/UI/CMakeLists.txt<br>add_library(UILib STATIC MainWindow.cpp)</pre><p><strong>Then in root:</strong></p><pre>add_executable(MyApp main.cpp)<br>target_link_libraries(MyApp CoreLib UILib)</pre><p><strong>So you get:</strong></p><p>CoreLib — reusable backend logic<br>UILib — reusable UI components<br>MyApp — the final app that uses them</p><h3>Why So Many target_* Commands?</h3><p>Because you don’t want to change things globally.<br> Instead, you do everything per-target, so your build is modular and clean.</p><p><strong>Example:</strong></p><pre>target_include_directories(CoreLib PRIVATE include/)<br>target_compile_definitions(UILib PUBLIC USE_QT)</pre><h3>What Happens When You Run CMake?</h3><p><strong>Step 1:</strong></p><pre>cmake -S . -B build/</pre><p><strong>Step 2:</strong></p><pre>cmake --build build/</pre><p><strong>What this does:</strong></p><p>CMakeLists.txt is read.<br>It finds what to build (targets).<br>It finds what libraries and dependencies are needed.<br>It generates a Makefile or build.ninja or .vcxproj.<br>You then build using make or ninja or an IDE.</p><h3>CMake Vocabulary You Must Know</h3><p>Let’s dive into some of the needed and important scripts:</p><pre>cmake_minimum_required(VERSION &lt;min_version&gt;)</pre><p>Sets the minimum version of CMake required to build the project.</p><pre>cmake_minimum_required(VERSION 3.16)</pre><pre>project(&lt;project_name&gt; VERSION &lt;version&gt; LANGUAGES &lt;lang1&gt; &lt;lang2&gt;)</pre><p>Defines the project name, version, and language.</p><pre>project(myApp VERSION 1.0 LANGUAGES CXX)</pre><pre>set(&lt;VAR_NAME&gt; &lt;value&gt;)</pre><p>Assigns a value to a variable.</p><pre>set(CMAKE_CXX_STANDARD 20)<br>set(SOURCES main.cpp utils.cpp)</pre><p>You can use the variable as ${CMAKE_CXX_STANDARD} and ${SOURCES}</p><pre>add_executable(&lt;target_name&gt; &lt;source_files...&gt;)</pre><p>Declares an executable to build.</p><pre>add_executable(myApp main.cpp utils.cpp)</pre><pre>add_library(&lt;target_name&gt; STATIC|SHARED &lt;source_files...&gt;)</pre><p>Creates a library (static or shared).</p><blockquote>Note:<br>add_executable → builds .exe or .app (for apps with main())<br>add_library → builds .a or .so (for reusable code or shared modules)<br>target_link_libraries(&lt;target_name&gt; &lt;libraries…&gt;)</blockquote><p>Links one target to other targets, frameworks, or libraries.</p><pre>target_link_libraries(myApp Qt6::Core Qt6::Quick customLib)</pre><pre>target_include_directories(&lt;target&gt; PUBLIC|PRIVATE &lt;dirs...&gt;)</pre><p>Adds header paths for a target.</p><pre>target_include_directories(customLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})</pre><pre>find_package(&lt;PackageName&gt; [REQUIRED] [COMPONENTS ...])</pre><p>Finds system-installed packages like Qt, Boost, or OpenCV.</p><pre>find_package(Qt6 REQUIRED COMPONENTS Core Quick Widgets)</pre><pre>find_path(&lt;VAR&gt; &lt;header&gt; [PATHS path1 path2 ...])</pre><p>Finds a directory containing a header.</p><pre>find_path(&quot;path here&quot; customLib.h)</pre><pre>find_library(&lt;VAR&gt; &lt;Library_name&gt; [PATHS path1 path2 ...])</pre><p>Finds the path to a compiled library (.a, .so, .lib)</p><pre>find_library(MYLIB_LIBRARY myLib)</pre><pre>add_subdirectory(&lt;folder&gt;)</pre><p>Adds a subfolder that contains its own CMakeLists.txt.</p><pre>add_subdirectory(src)<br>add_subdirectory(tests)</pre><pre>install(TARGETS &lt;target&gt; DESTINATION &lt;folder&gt;)<br>install(FILES &lt;file&gt; DESTINATION &lt;folder&gt;)</pre><p>Specifies install paths for targets or files.</p><pre>install(TARGETS myApp DESTINATION bin)</pre><pre>set_target_properties(&lt;target&gt; PROPERTIES &lt;key&gt; &lt;value&gt; ...)</pre><p>Sets advanced properties like bundle info or output name.</p><pre>set_target_properties(myApp PROPERTIES MACOSX_BUNDLE TRUE)</pre><pre>message</pre><p>Prints custom messages to the console during CMake configuration.</p><pre>message(STATUS &quot;Hello CMAKE&quot;)</pre><h3>Modular Build System (Separation of Concerns)</h3><p>What it means:<br>Split your project into independent parts (modules). Each part has its own job.</p><p><strong>Example:</strong><br>Imagine a project with:</p><p>UI/ — Handles how things look (buttons, windows)<br>Network/ — Handles internet communication<br>Utils/ — Handles helper functions</p><p>Each folder has its own CMakeLists.txt, so they can be built separately.</p><pre>project/<br>├── UI/<br>│   ├── Window.qml<br>│   └── CMakeLists.txt<br>├── Network/<br>│   ├── NetManager.cpp<br>│   └── CMakeLists.txt<br>├── main.cpp<br>└── CMakeLists.txt</pre><p><strong>Why it helps:</strong></p><p>Makes each module easy to understand and update<br>You can focus on one part at a time</p><h3>Faster Builds with Better Parallelism</h3><p><strong>What it means:</strong><br> When you change a file, only its module is rebuilt — not the whole project.</p><p><strong>Example:</strong><br>You change UI/Button.qml. Only the UI part needs to rebuild. The rest (like Network) is untouched.</p><pre># In UI/CMakeLists.txt<br>add_library(UI STATIC<br>    Button.qml<br>)</pre><p><strong>Why it helps:</strong></p><p>Saves time when compiling<br>Especially important in big projects with 100+ files<br>Clean Project Structure</p><p><strong>What it means:</strong><br>Keeps your project organized.</p><p><strong>Example:</strong></p><p><strong>Bad:</strong></p><pre>project/<br>├── main.cpp<br>├── NetManager.cpp<br>├── Window.qml<br>├── AppUtils.cpp</pre><p><strong>Good:</strong></p><pre>project/<br>├── UI/<br>├── Network/<br>├── Utils/</pre><p><strong>Why it helps:</strong></p><p>Easy to find things<br>Looks professional<br>Encourages teamwork (different people work on different folders)</p><h3>Scoped Dependencies and Linking</h3><p><strong>What it means:</strong><br>Only include what’s necessary in each module.</p><p><strong>Example:</strong><br>The Network module needs Qt’s network support. The UI module needs QtQuick.</p><pre># Network/CMakeLists.txt<br>target_link_libraries(Network Qt6::Network)</pre><pre># UI/CMakeLists.txt<br>target_link_libraries(UI Qt6::Quick)</pre><p><strong>Why it helps:</strong></p><p>Smaller binary<br>Faster to compile<br>You avoid bloating the entire app with unused stuff</p><h3>Testing and CI/CD Ease</h3><p><strong>What it means:</strong><br>You can write and run tests for each module.</p><p><strong>Example:</strong></p><pre>Utils/<br>├── MathHelper.cpp<br>├── CMakeLists.txt<br>└── tests/<br>    ├── test_MathHelper.cpp<br>    └── CMakeLists.txt</pre><p><strong>Why it helps:</strong></p><p>Test only what you need<br>Catch bugs early<br>Works great with GitHub Actions or GitLab CI</p><h3>Supports Plugins and Scalability</h3><p><strong>What it means:</strong><br>Big apps like QGroundControl support plugins. Each plugin is a subdirectory.<br><strong>Example:</strong></p><pre>Plugins/<br>├── GPSPlugin/<br>│   ├── GPS.cpp<br>│   └── CMakeLists.txt</pre><p>In the main CMakeLists.txt:</p><pre>add_subdirectory(Plugins/GPSPlugin)</pre><p><strong>Why it helps:</strong><br>Add or remove features easily<br>Users can build only what they need</p><p>Project structure example:</p><pre>MyApp/<br>├── CMakeLists.txt        # Root<br>├── main.cpp<br>├── UI/<br>│   └── CMakeLists.txt<br>├── Network/<br>│   └── CMakeLists.txt<br>└── Utils/<br>    └── CMakeLists.txt</pre><p>Root CMakeLists.txt:</p><pre>cmake_minimum_required(VERSION 3.16)<br>project(MyApp)</pre><pre>add_subdirectory(UI)<br>add_subdirectory(Network)<br>add_subdirectory(Utils)</pre><pre>add_executable(MyApp main.cpp)</pre><pre>target_link_libraries(MyApp<br>    UI<br>    Network<br>    Utils<br>    Qt6::Core<br>)</pre><p>UI/CMakeLists.txt:</p><pre>add_library(UI STATIC<br>    MainWindow.qml<br>)<br>target_link_libraries(UI Qt6::Quick)</pre><p>Structuring your C++ or Qt project with CMake properly from the beginning will save you hours in debugging, rebuilding, and scaling. With clear module boundaries, proper target scopes, and clean linking, your project becomes professional, maintainable, and ready for collaboration or production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c03012e521bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>