Skip to content

Instantly share code, notes, and snippets.

@naveenio
naveenio / diag_main.c
Created August 6, 2025 12:33
8380 Industrial
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
@naveenio
naveenio / backend for C - last fix storm control
Last active August 5, 2025 05:43
frontend for C optimized
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
@naveenio
naveenio / Industrial Main -
Created August 3, 2025 07:09
Industrail - Main - No compilation error - Vlan in progress
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
@naveenio
naveenio / gist:27590c4bd299326f1e7b5c6d9bc987a1
Created August 3, 2025 07:06
Backend routes to be converted to c
const express = require('express');
const cors = require('cors');
const crypto = require('crypto');
// Secret key for token signing (use environment variable in production)
const TOKEN_SECRET = 'your-secret-key-1234567890';
// Global users table with dummy users
@naveenio
naveenio / gist:c1d6650766422610235f14636f66dc83
Created August 2, 2025 10:53
main - no compilation errors - saturday
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
@naveenio
naveenio / gist:661a7d8c82c1ce02aa9b9871bfb18573
Created August 1, 2025 17:03
Middleware and User management
const express = require('express');
const crypto = require('crypto');
// Secret key for token signing (use environment variable in production)
const TOKEN_SECRET = 'your-secret-key-1234567890';
// Global users table with dummy users
let usersTable = [
{ id: 1, username: 'admin', password: 'admin123', privilege: 'admin' },
{ id: 2, username: 'user1', password: 'user123', privilege: 'normal' },
@naveenio
naveenio / ARP config backend
Last active August 1, 2025 07:23
Changes in front end + Backend
function isValidIp(ip) {
const ipRegex = /^(\d{1,3}\.){3}\d{1,3}$/;
if (!ipRegex.test(ip)) return false;
return ip.split('.').every(octet => parseInt(octet) >= 0 && parseInt(octet) <= 255);
}
@naveenio
naveenio / gist:f00a1fe33046b47f6d56032cca78fef1
Last active July 29, 2025 12:29
merged backend for priya mam
const express = require('express');
const cors = require('cors');
let systemConfig = {
description: "Managed Switch 7.4.8",
objectId: "1.3.6.1.4.1.12284.1",
version: "Managed Switch 7.4.8",
interfaces: 10,
@naveenio
naveenio / gist:c306cf059aec03fc0b8afc4bdc89a789
Last active July 27, 2025 08:08
FIxed compilation - bugs in vlan - mactable - and some other post requests
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
@naveenio
naveenio / gist:08d310e165b3d49eb85ef3f7e87b2073
Created July 27, 2025 02:57
C - working build - compiled
/*
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
* All Rights Reserved.
*
* This program is the proprietary software of Realtek Semiconductor
* Corporation and/or its licensors, and only be used, duplicated,
* modified or distributed under the authorized license from Realtek.
*
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.